[Bugfix] Fix fallback loading for IndexTTS external models (#6137)

Signed-off-by: boatman <109857087+sphinxkkkbc@users.noreply.github.com>
This commit is contained in:
boatman authored and GitHub committed 2026-09-04 19:58:33 -07:00
1 parent 1e74807c35
commit 66bbebd9d3
4 files changed
+38 -9

No files matched your search

@@ -102,9 +102,6 @@ def load_wav2vec2(model_path: str, device: torch.device):
except Exception as exc:
raise RuntimeError(f"Failed to load local IndexTTS Wav2Vec2-BERT assets from {local_dir!r}") from exc
if local_dir is None and os.path.isdir(model_path):
raise FileNotFoundError(f"IndexTTS Wav2Vec2-BERT assets are missing from local bundle {model_path!r}")
# Try a remote model subfolder, then the public base model.
try:
if model is None or processor is None:
@@ -173,8 +170,6 @@ def load_semantic_codec(
state = torch.load(ckpt_path, map_location="cpu", weights_only=True)
codec.load_state_dict(state, strict=False)
else:
if os.path.isdir(model_path):
raise FileNotFoundError(f"IndexTTS RepCodec checkpoint is missing from local bundle {model_path!r}")
import safetensors.torch
from huggingface_hub import hf_hub_download
@@ -203,8 +198,6 @@ def load_campplus(model_path: str, device: torch.device):
if ckpt_path is not None:
break
if ckpt_path is None:
if os.path.isdir(model_path):
raise FileNotFoundError(f"IndexTTS CAMPPlus checkpoint is missing from local bundle {model_path!r}")
from huggingface_hub import hf_hub_download
ckpt_path = hf_hub_download("funasr/campplus", filename="campplus_cn_common.bin")