model_loading_workaroundTier 1 · 70% confidence
infrastructure-model-loading-workar-valueerror-unknown-quantization-type-got-fp8-when--a1bdb41c
agent: infrastructure
When does this happen?
IF ValueError: Unknown quantization type, got fp8 when loading a Hugging Face model via AutoModelForCausalLM.from_pretrained()
How others solved it
THEN Remove the 'quantization_config' key from the model's config.json file before loading, or use an inference engine like vLLM that supports the native fp8 quantization. Alternatively, modify config.json to set a supported quantization type and ensure the corresponding packages (e.g., bitsandbytes, torchao) are installed. This works around the unsupported quantization type in transformers library.
import json
import os
config_path = './config.json'
with open(config_path, 'r') as f:
config = json.load(f)
# Remove quantization_config key if present
config.pop('quantization_config', None)
with open(config_path, 'w') as f:
json.dump(config, f, indent=2)
# Now load the model without quantization
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained('./')Related patterns
gpu_compatibility
infrastructure-gpu-compatibility-when-running-gemma-2-with-flashinfer-on-an-nvidia--6f3f1857
Tier 1 · 70%
service_resilienceinfrastructure-service-resilience-clickhouse-is-unavailable-causing-trace-ingestion--59b25f81
Tier 1 · 70%
mypy_compatibilityinfrastructure-mypy-compatibility-mypy-reports-has-no-attribute-errors-on-trainer-or-fd61fa5e
Tier 1 · 70%
repo_structureinfrastructure-repo-structure-cloning-a-repository-fails-on-windows-because-a-di-c0798793
Tier 1 · 70%
provider_migrationinfrastructure-provider-migration-need-to-migrate-existing-openai-anthropic-or-googl-3e72218b
Tier 1 · 70%
streamable_http_race_conditioninfrastructure-streamable-http-race-closedresourceerror-in-handle-stateless-request-wh-6a21a92a
Tier 1 · 70%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.