fix: remove quantization_config after loading to bypass SFTTrainer check
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user