Skip to content
Open
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
14 changes: 14 additions & 0 deletions omlx/model_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,20 @@ def detect_model_type(model_path: Path) -> ModelType:
if normalized_type.startswith("lfm") and normalized_type not in EMBEDDING_MODEL_TYPES:
return "audio_sts"

# Directory-name fallback for audio models whose config.json omits model_type.
# Some model families (e.g. NeMo-format parakeet) do not include a top-level
# model_type field, so the checks above find nothing. As a last resort, match
# the first hyphen-separated segment of the model directory name against the
# same mlx-audio model-type sets used above.
dir_stem = model_path.name.lower().split("-")[0]
if dir_stem and dir_stem not in _LLM_TYPE_COLLISIONS:
if dir_stem in AUDIO_TTS_MODEL_TYPES:
return "audio_tts"
if dir_stem in AUDIO_STT_MODEL_TYPES:
return "audio_stt"
if dir_stem in AUDIO_STS_MODEL_TYPES:
return "audio_sts"

return "llm"


Expand Down