mod gemma
This commit is contained in:
parent
b822c32206
commit
51828191cc
19
gemma.py
19
gemma.py
|
|
@ -64,17 +64,18 @@ tokenized_dataset = dataset.map(tokenize_function, batched=True)
|
|||
# 8️⃣ Parametry treningu
|
||||
training_args = TrainingArguments(
|
||||
output_dir="./results",
|
||||
per_device_train_batch_size=2,
|
||||
gradient_accumulation_steps=4, # Symuluje większy batch size
|
||||
num_train_epochs=5,
|
||||
logging_dir="./logs",
|
||||
save_strategy="epoch",
|
||||
evaluation_strategy="steps", # Zmienione na "steps"
|
||||
eval_steps=500, # Dodane
|
||||
save_strategy="steps", # Zmienione na "steps"
|
||||
save_steps=500, # Dodane, musi być takie samo jak eval_steps lub jego wielokrotność
|
||||
learning_rate=2e-5,
|
||||
warmup_steps=100,
|
||||
fp16=True, # Używa mixed precision training
|
||||
evaluation_strategy="steps",
|
||||
eval_steps=500,
|
||||
per_device_train_batch_size=2,
|
||||
per_device_eval_batch_size=2,
|
||||
num_train_epochs=5,
|
||||
weight_decay=0.01,
|
||||
load_best_model_at_end=True,
|
||||
metric_for_best_model="loss", # lub inna metryka, którą chcesz optymalizować
|
||||
greater_is_better=False, # Ustaw na True, jeśli wyższa wartość metryki jest lepsza
|
||||
)
|
||||
|
||||
# 9️⃣ Data Collator
|
||||
|
|
|
|||
Loading…
Reference in New Issue