{"record":{"id":"000e6d185fb47072","repo":"fishaudio/fish-speech","slug":"unknown-model-type-data-model-type","errorCode":null,"errorMessage":"Unknown model type: {data['model_type']}","messagePattern":"Unknown model type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"fish_speech/models/text2semantic/llama.py","lineNumber":93,"sourceCode":"    @staticmethod\n    def from_pretrained(path: str):\n        path = Path(path)\n\n        if path.is_dir():\n            path = path / \"config.json\"\n\n        with open(path, \"r\", encoding=\"utf-8\") as f:\n            data = json.load(f)\n\n        match data[\"model_type\"]:\n            case \"naive\":\n                cls = NaiveModelArgs\n            case \"dual_ar\":\n                cls = DualARModelArgs\n            case \"fish_qwen3_omni\":\n                return BaseModelArgs._from_fish_qwen3_omni(data)\n            case _:\n                raise ValueError(f\"Unknown model type: {data['model_type']}\")\n\n        # Filter out unexpected keyword arguments\n        valid_keys = {f.name for f in dataclasses.fields(cls)}\n        data = {k: v for k, v in data.items() if k in valid_keys}\n\n        return cls(**data)\n\n    @staticmethod\n    def _from_fish_qwen3_omni(data: dict) -> \"DualARModelArgs\":\n        tc = data[\"text_config\"]\n        adc = data[\"audio_decoder_config\"]\n        flat = dict(\n            model_type=\"dual_ar\",\n            vocab_size=tc[\"vocab_size\"],\n            n_layer=tc[\"n_layer\"],\n            n_head=tc[\"n_head\"],\n            n_local_heads=tc.get(\"n_local_heads\", -1),\n            head_dim=tc.get(\"head_dim\"),","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/fishaudio/fish-speech/blob/befe4001745417f8c42131739d862b8a6fdbd15a/fish_speech/models/text2semantic/llama.py#L75-L111","documentation":"BaseModelArgs.from_pretrained dispatches on the model_type field of the config and raises when it matches neither 'naive', 'dual_ar', nor 'fish_qwen3_omni'. The value comes from the model directory's config (usually fish_config.json / config.yaml).","triggerScenarios":"Loading a checkpoint whose config has a model_type string not supported by the installed fish-speech version (e.g. an older config naming or a new architecture on an older install).","commonSituations":"Loading third-party or fine-tuned checkpoints; upgrading/downgrading fish-speech while reusing old model directories; hand-edited configs.","solutions":["Check model_type in the model's config file and correct typos (valid: naive, dual_ar, fish_qwen3_omni)","Upgrade fish-speech to a version supporting the checkpoint's architecture","Re-export the model from a matching fish-speech version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json\ncfg = json.load(open(model_dir / \"config.yaml\"))\nassert cfg[\"model_type\"] in {\"naive\", \"dual_ar\", \"fish_qwen3_omni\"}, cfg[\"model_type\"]","typeGuard":null,"tryCatchPattern":"try:\n    model = BaseTransformer.from_pretrained(path)\nexcept ValueError as e:\n    if \"Unknown model type\" in str(e):\n        raise RuntimeError(f\"Upgrade fish-speech to load {path}\") from e\n    raise","preventionTips":["Pin fish-speech version to the checkpoint release","Validate model_type from config before loading"],"tags":["model-loading","config","version-mismatch"],"backgroundTag":"unsupported-model-type","analyzedSha":"befe4001745417f8c42131739d862b8a6fdbd15a","analyzedAt":"2026-08-27T21:31:45.703Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}