fix: remove quantization_config after loading to bypass SFTTrainer check

This commit is contained in:
Christian Medina
2026-07-01 07:36:38 -04:00
parent 86b401c12f
commit f47944ee75
2 changed files with 3 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ train_params:
learning_rate: 2e-4 learning_rate: 2e-4
lr_scheduler_type: cosine lr_scheduler_type: cosine
weight_decay: 0.01 weight_decay: 0.01
warmup_ratio: 0.03 warmup_ratio: 0.03 # Will be converted to warmup_steps by TrainingArguments
max_seq_length: 1024 max_seq_length: 1024
logging_steps: 10 logging_steps: 10
save_steps: 100 save_steps: 100

View File

@@ -40,6 +40,8 @@ def train(config_path):
device_map="cpu", # Load to CPU first device_map="cpu", # Load to CPU first
trust_remote_code=True, trust_remote_code=True,
) )
# Remove quantization config to avoid SFTTrainer validation error
model.config.quantization_config = None
print("Model loaded and converted to bf16.") print("Model loaded and converted to bf16.")
# Add LoRA # Add LoRA