{"record":{"id":"d803fc6f67078df2","repo":"invoke-ai/InvokeAI","slug":"missing-text-encoder-2-model-safetensors-index-jso","errorCode":null,"errorMessage":"missing text_encoder_2/model.safetensors.index.json","messagePattern":"missing text_encoder_2/model\\.safetensors\\.index\\.json","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"info","filePath":"invokeai/backend/model_manager/configs/t5_encoder.py","lineNumber":60,"sourceCode":"    def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:\n        raise_if_not_dir(mod)\n\n        raise_for_override_fields(cls, override_fields)\n\n        expected_config_path = mod.path / \"text_encoder_2\" / \"config.json\"\n        expected_class_name = \"T5EncoderModel\"\n        raise_for_class_name(expected_config_path, expected_class_name)\n\n        cls.raise_if_doesnt_have_unquantized_config_file(mod)\n\n        return cls(**override_fields)\n\n    @classmethod\n    def raise_if_doesnt_have_unquantized_config_file(cls, mod: ModelOnDisk) -> None:\n        has_unquantized_config = (mod.path / \"text_encoder_2\" / \"model.safetensors.index.json\").exists()\n\n        if not has_unquantized_config:\n            raise NotAMatchError(\"missing text_encoder_2/model.safetensors.index.json\")\n\n\nclass T5Encoder_BnBLLMint8_Config(Config_Base):\n    \"\"\"Configuration for T5 Encoder models quantized by bitsandbytes' LLM.int8.\"\"\"\n\n    base: Literal[BaseModelType.Any] = Field(default=BaseModelType.Any)\n    type: Literal[ModelType.T5Encoder] = Field(default=ModelType.T5Encoder)\n    format: Literal[ModelFormat.BnbQuantizedLlmInt8b] = Field(default=ModelFormat.BnbQuantizedLlmInt8b)\n    cpu_only: bool | None = Field(default=None, description=\"Whether this model should run on CPU only\")\n\n    @classmethod\n    def from_model_on_disk(cls, mod: ModelOnDisk, override_fields: dict[str, Any]) -> Self:\n        raise_if_not_dir(mod)\n\n        raise_for_override_fields(cls, override_fields)\n\n        expected_config_path = mod.path / \"text_encoder_2\" / \"config.json\"\n        expected_class_name = \"T5EncoderModel\"","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/t5_encoder.py#L42-L78","documentation":"NotAMatchError raised by T5Encoder_BnBLLMint8_Config.raise_if_doesnt_have_unquantized_config_file during model identification. The bnb LLM.int8 T5 encoder config requires a `text_encoder_2/model.safetensors.index.json` sharded-index file to positively identify the model as a FLUX-style T5 encoder; without it this candidate config declines the match. In InvokeAI's scan pipeline this is a normal probe rejection, not a crash.","triggerScenarios":"Calling from_model_on_disk on a model dir where (path/text_encoder_2/model.safetensors.index.json) does not exist — e.g. single-file text_encoder_2 weights, a diffusers layout using model.safetensors (unsharded), or the T5 weights stored elsewhere.","commonSituations":"Downloading only part of a FLUX repo (skipping sharded T5 files), converting a checkpoint to a single safetensors file, placing text_encoder_2 weights at the wrong nesting level, or manually reorganizing diffusers folders.","solutions":["Ensure `text_encoder_2/model.safetensors.index.json` exists at the model root (re-download the T5 encoder files from the source diffusers repo)","If the T5 weights are a single unsharded model.safetensors, this config legitimately does not apply; let another config match or convert/reshard the model","Verify directory layout: model_root/text_encoder_2/ must contain the index json, not a nested subfolder"],"exampleFix":"// before\nflux-model/\n  text_encoder_2/\n    model-00001-of-00002.safetensors\n// after\nflux-model/\n  text_encoder_2/\n    model.safetensors.index.json\n    model-00001-of-00002.safetensors\n    model-00002-of-00002.safetensors","handlingStrategy":"validation","validationCode":"from pathlib import Path\ndef has_bnb_t5_index(model_dir: Path) -> bool:\n    return (model_dir / \"text_encoder_2\" / \"model.safetensors.index.json\").exists()","typeGuard":null,"tryCatchPattern":"try:\n    install_model(path)\nexcept NotAMatchError as e:\n    if \"missing text_encoder_2/model.safetensors.index.json\" in str(e):\n        logger.warning(\"T5 encoder is not a sharded llm_int8 layout; trying generic config\")\n        install_model(path, config_path=GENERIC_T5_CONFIG)","preventionTips":["Download the complete diffusers repo including the sharded T5 index json","Validate the folder layout before installing (text_encoder_2/ with index + all shards)","Avoid renaming or moving text_encoder_2 contents"],"tags":["model-identification","diffusers","not-a-match"],"backgroundTag":"model-scan-no-match","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}