{"record":{"id":"689f8ae1cf712a65","repo":"fishaudio/fish-speech","slug":"no-model-weights-found-in-path-obj","errorCode":null,"errorMessage":"No model weights found in {path_obj}","messagePattern":"No model weights found in (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"fish_speech/models/text2semantic/llama.py","lineNumber":585,"sourceCode":"                weights = _remap_fish_qwen3_omni_keys(weights)\n            elif pth_file.exists():\n                weights = torch.load(\n                    pth_file,\n                    map_location=\"cpu\",\n                    mmap=True,\n                    weights_only=True,\n                )\n                if \"state_dict\" in weights:\n                    weights = weights[\"state_dict\"]\n                if weights and next(iter(weights.keys())).startswith(\"model.\"):\n                    weights = OrderedDict(\n                        (k.replace(\"model.\", \"\"), v) for k, v in weights.items()\n                    )\n                for k in list(weights.keys()):\n                    if \"audio_\" in k:\n                        weights.pop(k)\n            else:\n                raise FileNotFoundError(f\"No model weights found in {path_obj}\")\n\n            err = model.load_state_dict(weights, strict=False, assign=True)\n            logger.info(f\"Model weights loaded - Status: {err}\")\n\n        if lora_config is not None:\n            setup_lora(model, lora_config)\n            logger.info(f\"LoRA setup: {lora_config}\")\n\n        return model\n\n    def save_pretrained(self, path: str, drop_lora: bool = False):\n        path = Path(path)\n        path.mkdir(parents=True, exist_ok=True)\n\n        self.config.save(path / \"config.json\")\n        state_dict = self.state_dict()\n\n        if drop_lora:","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/fishaudio/fish-speech/blob/befe4001745417f8c42131739d862b8a6fdbd15a/fish_speech/models/text2semantic/llama.py#L567-L603","documentation":"from_pretrained searches the given path for weight files (model.pth, safetensors, etc.); if none is found it raises FileNotFoundError. The directory exists but contains no recognized weights.","triggerScenarios":"Pointing --llama-model-path/--model-path at an empty or incomplete directory, a config-only folder, or a path with only the VQ weights.","commonSituations":"Interrupted model downloads, extracting a partial archive, or passing the repo root instead of the model subfolder.","solutions":["List the directory and confirm it contains model.pth / *.safetensors","Re-download the model weights fully","Point the path at the directory that actually holds the transformer weights (not just config or tokenizer files)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\ndef has_weights(p):\n    p = Path(p)\n    return any(p.rglob(\"*.pth\")) or any(p.rglob(\"*.safetensors\"))\nassert has_weights(model_path)","typeGuard":null,"tryCatchPattern":"try:\n    BaseTransformer.from_pretrained(path)\nexcept FileNotFoundError:\n    re_download_model()","preventionTips":["Verify weights exist before launch","Checksum-verify downloads"],"tags":["model-loading","file-not-found","download"],"backgroundTag":"missing-model-weights","analyzedSha":"befe4001745417f8c42131739d862b8a6fdbd15a","analyzedAt":"2026-08-27T21:31:45.703Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}