Kevin Fink
commited on
Commit
·
df08c41
1
Parent(s):
edf2399
dev
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
54 |
# Load the model and tokenizer
|
55 |
|
56 |
|
57 |
-
|
58 |
# Set training arguments
|
59 |
training_args = TrainingArguments(
|
60 |
output_dir='/data/results',
|
@@ -68,15 +68,15 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
68 |
gradient_accumulation_steps=int(grad),
|
69 |
#max_grad_norm = 3.0,
|
70 |
load_best_model_at_end=True,
|
71 |
-
metric_for_best_model="accuracy",
|
72 |
-
greater_is_better=True,
|
73 |
logging_dir='/data/logs',
|
74 |
logging_steps=10,
|
75 |
#push_to_hub=True,
|
76 |
hub_model_id=hub_id.strip(),
|
77 |
fp16=True,
|
78 |
#lr_scheduler_type='cosine',
|
79 |
-
save_steps=
|
80 |
save_total_limit=3,
|
81 |
)
|
82 |
# Check if a checkpoint exists and load it
|
|
|
54 |
# Load the model and tokenizer
|
55 |
|
56 |
|
57 |
+
print(f"BATCH: {batch_size}")
|
58 |
# Set training arguments
|
59 |
training_args = TrainingArguments(
|
60 |
output_dir='/data/results',
|
|
|
68 |
gradient_accumulation_steps=int(grad),
|
69 |
#max_grad_norm = 3.0,
|
70 |
load_best_model_at_end=True,
|
71 |
+
#metric_for_best_model="accuracy",
|
72 |
+
#greater_is_better=True,
|
73 |
logging_dir='/data/logs',
|
74 |
logging_steps=10,
|
75 |
#push_to_hub=True,
|
76 |
hub_model_id=hub_id.strip(),
|
77 |
fp16=True,
|
78 |
#lr_scheduler_type='cosine',
|
79 |
+
save_steps=500, # Save checkpoint every 500 steps
|
80 |
save_total_limit=3,
|
81 |
)
|
82 |
# Check if a checkpoint exists and load it
|