fix: disable quantization config for fp8 model training

This commit is contained in:
Christian Medina
2026-06-30 22:41:28 -04:00
parent a8c9cd682e
commit 3bb7328e2a

View File

@@ -32,13 +32,14 @@ def train(config_path):
print(f"Loading model: {config['base_model']}")
# Load model - let the model's own quantization config handle it
# (Ornith uses CompressedTensors, not BitsAndBytes)
# Load on CPU first, then DeepSpeed will distribute
# Load model in bf16 (fp8 not supported for training)
# Disable quantization config to train full precision
model = AutoModelForCausalLM.from_pretrained(
config["base_model"],
dtype=torch.bfloat16,
device_map="cpu", # Load on CPU, DeepSpeed distributes
torch_dtype=torch.bfloat16,
device_map="cpu",
quantization_config=None, # Override any fp8 quantization
trust_remote_code=True,
)
# Add LoRA