{"record":{"id":"3be5b4ead050f9f6","repo":"invoke-ai/InvokeAI","slug":"missing-config-path","errorCode":null,"errorMessage":"missing {config_path}","messagePattern":"missing (.+?)","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/model_manager/configs/qwen_vl_encoder.py","lineNumber":96,"sourceCode":"\n        # Reject anything that looks like a full pipeline (those are matched as Main models).\n        if (mod.path / \"model_index.json\").exists() or (mod.path / \"transformer\").exists():\n            raise NotAMatchError(\n                \"directory looks like a full diffusers pipeline (has model_index.json or transformer folder), \"\n                \"not a standalone Qwen VL encoder\"\n            )\n\n        text_encoder_dir = mod.path / \"text_encoder\"\n        tokenizer_dir = mod.path / \"tokenizer\"\n\n        if not text_encoder_dir.is_dir():\n            raise NotAMatchError(\"missing text_encoder/ subfolder\")\n        if not tokenizer_dir.is_dir():\n            raise NotAMatchError(\"missing tokenizer/ subfolder\")\n\n        config_path = text_encoder_dir / \"config.json\"\n        if not config_path.is_file():\n            raise NotAMatchError(f\"missing {config_path}\")\n\n        try:\n            with open(config_path, \"r\", encoding=\"utf-8\") as f:\n                cfg = json.load(f)\n        except (OSError, json.JSONDecodeError) as e:\n            raise NotAMatchError(f\"could not read text_encoder/config.json: {e}\") from e\n\n        class_name = cfg.get(\"_class_name\")\n        architectures = cfg.get(\"architectures\") or []\n        candidates = {class_name, *architectures} - {None}\n\n        if not candidates & _RECOGNIZED_TEXT_ENCODER_CLASSES:\n            raise NotAMatchError(\n                f\"text_encoder class is {sorted(candidates) or 'unknown'}, \"\n                f\"expected one of {sorted(_RECOGNIZED_TEXT_ENCODER_CLASSES)}\"\n            )\n\n        return cls(**override_fields)","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/qwen_vl_encoder.py#L78-L114","documentation":"`NotAMatchError` with `missing {config_path}` means the `text_encoder/config.json` file does not exist inside the model directory. `from_model_on_disk` reads this JSON to identify the encoder class; with no config file the directory cannot be recognized as a Qwen VL text encoder, so the config class declines the match.","triggerScenarios":"Probing a model dir where `text_encoder/` exists as a directory but contains no `config.json` — e.g. only `.safetensors` weights were downloaded, the config.json was deleted, or the folder name is misspelled (`text_encode/`).","commonSituations":"Selective HF downloads that fetch only weight shards, `git lfs` partial checkouts where json files were not pulled, manual cleanup that removed 'small' json files, or configs flattened out of the subfolder.","solutions":["Copy `config.json` from the corresponding Qwen2.5-VL/Qwen2-VL HF repo into `text_encoder/`","Re-download the `text_encoder` folder completely (all json + safetensors files)","Check for typos in the path; the file must be exactly `text_encoder/config.json`"],"exampleFix":"// before\nhuggingface-cli download Qwen/Qwen2.5-VL-7B --include \"*.safetensors\"\n// after\nhuggingface-cli download Qwen/Qwen2.5-VL-7B --include \"text_encoder/*\"","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef has_text_encoder_config(path: Path) -> bool:\n    return (path / \"text_encoder\" / \"config.json\").is_file()","typeGuard":"def has_config_json(model_dir: Path) -> bool:\n    cfg = model_dir / \"text_encoder\" / \"config.json\"\n    return cfg.is_file() and cfg.stat().st_size > 0","tryCatchPattern":"try:\n    cfg = QwenVLTextEncoderConfig.from_model_on_disk(mod, override_fields)\nexcept NotAMatchError as e:\n    if \"missing\" in str(e) and \"config.json\" in str(e):\n        raise RuntimeError(f\"Incomplete download: {mod.path} lacks text_encoder/config.json\") from e\n    raise","preventionTips":["Download text_encoder folders with all files (json + safetensors), not weights only","Never delete 'small' json files to save space","Verify file presence after download: `test -f text_encoder/config.json`","Avoid renaming subfolders inside the model directory"],"tags":["model-install","qwen-vl","missing-file"],"backgroundTag":"missing-model-config-file","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}