Views
No views yet
1
2from transformers import TrainingArguments, Trainer
3from unsloth import is_bfloat16_supported
4
5trainer = Trainer(
6 model = model,
7 train_dataset = processed_ds,
8 args = TrainingArguments(
9 per_device_train_batch_size = 2,
10 gradient_accumulation_steps = 4,
11 warmup_steps = 5,
12 max_steps = 2000,
13 learning_rate = 2e-4,
14 fp16 = not is_bfloat16_supported(),
15 bf16 = is_bfloat16_supported(),
16 logging_steps = 1,
17 optim = "adamw_8bit",
18 weight_decay = 0.001, # Turn this on if overfitting
19 lr_scheduler_type = "linear",
20 seed = 3407,
21 output_dir = "outputs",
22 report_to = "none", # Use TrackIO/WandB etc
23 ),
24)