{"record":{"id":"258df13c59505643","repo":"invoke-ai/InvokeAI","slug":"state-dict-does-not-look-like-gguf-quantized-258df1","errorCode":null,"errorMessage":"state dict does not look like GGUF quantized","messagePattern":"state dict does not look like GGUF quantized","errorType":"validation","errorClass":"NotAMatchError","httpStatus":null,"severity":"info","filePath":"invokeai/backend/model_manager/configs/t5_encoder.py","lineNumber":233,"sourceCode":"        cls.raise_if_doesnt_look_like_gguf_quantized(mod)\n\n        return cls(**override_fields)\n\n    @classmethod\n    def raise_if_doesnt_look_like_t5_encoder(cls, mod: ModelOnDisk) -> None:\n        # llama.cpp T5 encoders use the ``enc.`` prefix on their transformer blocks and final norm. This\n        # distinguishes them from decoder-only GGUF models (e.g. Qwen3, which uses bare ``blk.*``).\n        state_dict = mod.load_state_dict()\n        if not state_dict_has_any_keys_starting_with(\n            state_dict, \"enc.blk.\"\n        ) and not state_dict_has_any_keys_ending_with(state_dict, \"enc.output_norm.weight\"):\n            raise NotAMatchError(\"state dict does not look like a T5 encoder (no 'enc.blk.*' keys)\")\n\n    @classmethod\n    def raise_if_doesnt_look_like_gguf_quantized(cls, mod: ModelOnDisk) -> None:\n        has_ggml = any(isinstance(v, GGMLTensor) for v in mod.load_state_dict().values())\n        if not has_ggml:\n            raise NotAMatchError(\"state dict does not look like GGUF quantized\")\n","sourceCodeStart":215,"sourceCodeEnd":234,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/model_manager/configs/t5_encoder.py#L215-L234","documentation":"NotAMatchError from raise_if_doesnt_look_like_gguf_quantized. After confirming T5 block keys, the GGUF config verifies the loaded state dict actually contains GGMLTensor values (the ComfyUI-style quantized tensor wrapper). A T5-shaped state dict with no GGMLTensors is not gguf-quantized, so the config declines.","triggerScenarios":"from_model_on_disk on a model whose load_state_dict() values contain no GGMLTensor instances — e.g. a .safetensors T5 probed against the gguf config, or a gguf file loaded without the gguf loader producing GGMLTensor objects.","commonSituations":"Giving the file a .gguf extension without actually converting, scanning fp16 safetensors T5 against the gguf config, or missing/incompatible gguf-quant libraries so tensors dequantize to plain tensors.","solutions":["Ensure the file is a genuine gguf conversion (convert with city96's tooling) and rescanned","Install/repair the gguf quantization support libraries so tensors load as GGMLTensor","Register the (unquantized) T5 under a non-gguf config explicitly"],"exampleFix":"// before\ncp t5-encoder.safetensors t5-encoder.gguf   # not a real conversion\n// after\npython convert_sd_to_gguf.py t5-encoder.safetensors --out t5-encoder-Q8_0.gguf","handlingStrategy":"validation","validationCode":"def is_real_gguf(gguf_path) -> bool:\n    from invokeai.backend.quantization.gguf import load_gguf_state_dict\n    from invokeai.backend.quantization.gguf import GGMLTensor\n    return any(isinstance(v, GGMLTensor) for v in load_gguf_state_dict(gguf_path).values())","typeGuard":null,"tryCatchPattern":"try:\n    install_model(path)\nexcept NotAMatchError as e:\n    if \"GGUF quantized\" in str(e):\n        logger.error(\"File is not genuine gguf (renamed safetensors?); convert or reinstall\")","preventionTips":["Never rename .safetensors to .gguf; run a real conversion","Keep gguf-quant support libraries installed and up to date","Verify the magic bytes (GGUF header) before installing"],"tags":["gguf","ggml","state-dict"],"backgroundTag":"quantization-format-mismatch","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}