{"record":{"id":"d0163622d510773d","repo":"invoke-ai/InvokeAI","slug":"the-embedding-file-at-path-was-not-found","errorCode":null,"errorMessage":"The embedding file at {path} was not found","messagePattern":"The embedding file at (.+?) was not found","errorType":"exception","errorClass":"OSError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/load/model_loaders/textual_inversion.py","lineNumber":50,"sourceCode":"        if submodel_type is not None:\n            raise ValueError(\"There are no submodels in a TI model.\")\n        model = TextualInversionModelRaw.from_checkpoint(\n            file_path=config.path,\n            dtype=self._torch_dtype,\n        )\n        return model\n\n    # override\n    def _get_model_path(self, config: AnyModelConfig) -> Path:\n        model_path = self._app_config.models_path / config.path\n\n        if config.format == ModelFormat.EmbeddingFolder:\n            path = model_path / \"learned_embeds.bin\"\n        else:\n            path = model_path\n\n        if not path.exists():\n            raise OSError(f\"The embedding file at {path} was not found\")\n\n        return path\n","sourceCodeStart":32,"sourceCodeEnd":53,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/load/model_loaders/textual_inversion.py#L32-L53","documentation":"The textual inversion loader (_get_model_path) resolves the embedding's path: folder-format embeddings expect a learned_embeds.bin file inside the model directory, while single-file formats use the model path directly. If the resolved path does not exist on disk, an OSError is raised. This means the model record points at files that are missing or misnamed.","triggerScenarios":"Installing a textual inversion embedding where config.format == ModelFormat.EmbeddingFolder but the folder lacks learned_embeds.bin; the registered path was moved/renamed; or a scan registered a stale path for a deleted file.","commonSituations":"Manual download extracted incompletely; user renamed the .bin/.pt file or placed a folder-format embedding without the expected inner filename; model directory moved after registration; network- interrupted download.","solutions":["Verify the file exists at the path shown in the message; re-download or re-extract the embedding if missing.","For EmbeddingFolder format, ensure the folder contains learned_embeds.bin (rename your file to that name or re-download the official folder layout).","Delete the model from InvokeAI's model manager and re-import/scan it so the stored path is refreshed.","Check the model record's path field in the models database/directory and correct it to the actual location."],"exampleFix":"// before (folder missing expected file)\nmy_embedding/\n  embed.pt\n\n// after\nmy_embedding/\n  learned_embeds.bin","handlingStrategy":"validation","validationCode":"import os\nfrom pathlib import Path\ndef validate_embedding(config, model_path):\n    path = model_path / 'learned_embeds.bin' if str(config.format).endswith('EmbeddingFolder') else model_path\n    if not Path(path).exists():\n        raise FileNotFoundError(f\"Embedding file missing: {path} — re-download or fix the model path\")","typeGuard":null,"tryCatchPattern":"try:\n    path = loader._get_model_path(config, model_path)\nexcept OSError as e:\n    logger.warning(\"Embedding missing, re-importing: %s\", e)\n    reinstall_model(config)","preventionTips":["After downloading an embedding, verify the expected file (learned_embeds.bin for folder format) exists before registering.","Avoid moving/renaming InvokeAI model directories without re-scanning.","Verify checksums of downloads to catch truncated files."],"tags":["filesystem","model-loading","textual-inversion"],"backgroundTag":"file-not-found","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}