Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/mlx_speech/models/moss_delay/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ def from_dict(cls, payload: dict[str, Any]) -> "MossTTSDelayConfig":

@classmethod
def from_path(cls, model_dir: str | Path) -> "MossTTSDelayConfig":
config_path = Path(model_dir) / "config.json"
model_dir = Path(model_dir)
config_path = model_dir / "config.json"
if not config_path.exists():
raise FileNotFoundError(f"Config file not found: {config_path}")
for subdir in ("mlx-4bit", "mlx-int8", "mlx-8bit"):
candidate = model_dir / subdir / "config.json"
if candidate.exists():
config_path = candidate
break
else:
raise FileNotFoundError(f"Config file not found: {config_path}")
with config_path.open(encoding="utf-8") as f:
payload = json.load(f)
return cls.from_dict(payload)
Expand Down
11 changes: 10 additions & 1 deletion src/mlx_speech/tts/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ def _resolve_tts_family(model_dir: Path) -> str:
n_vq = int(payload.get("n_vq", 0))
return "moss_local" if n_vq > 20 else "moss_delay"

if model_type == "qwen3":
dir_lower = str(model_dir).lower()
if "sound_effect" in dir_lower or "sound-effect" in dir_lower:
return "moss_sound_effect"
n_vq = int(payload.get("n_vq", 0))
if n_vq > 20:
return "moss_local"
return "moss_delay"

raise ValueError(
f"Unknown TTS model_type {model_type!r} in {model_dir}. "
"Supported: fish_qwen3_omni, vibevoice, audiodit, step1, moss_tts_delay."
"Supported: fish_qwen3_omni, vibevoice, audiodit, step1, moss_tts_delay, qwen3."
)