expected str, bytes or os.PathLike object, not MultiplexedPath

错误信息显示:

TypeError: expected str, bytes or os.PathLike object, not MultiplexedPath

这个错误是因为 tn库(text normalization库)在创建缓存目录时收到了一个 MultiplexedPath对象而不是字符串路径。

MultiplexedPath是 HuggingFace 的 huggingface_hub库中的类型,通常用于处理多个缓存位置。

查看错误栈,问题出现在:

File "/home/bysx/index-tts-vllm2/indextts/utils/front.py", line 111, in load

self.en_normalizer = NormalizerEn(overwrite_cache=False)

根据错误信息,现在的问题是在加载en_normalizer时,cache_dir参数的类型不正确。

NormalizerEninit中,build_fst方法尝试创建目录时,使用传入的cache_dir

如果没有指定cache_dir,那么就会使用默认的缓存目录。

但是,如果默认的缓存目录是MultiplexedPath类型,就会有问题。

我们可以修改为:

self.en_normalizer = NormalizerEn(overwrite_cache=False, cache_dir=cache_dir)


expected str, bytes or os.PathLike object, not MultiplexedPath
https://mingsm17518.github.io/2026/01/30/bug修复/expected str, bytes or os.PathLike object, not MultiplexedPath/
作者
Ming
发布于
2026年1月30日
更新于
2026年2月2日
许可协议