Kevin Fink
commited on
Commit
·
66722b9
1
Parent(s):
cab69d9
dev
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def fine_tune_model(model_name, dataset_name, hub_id, api_key, num_epochs, batch
|
|
58 |
hub_model_id=hub_id.strip(),
|
59 |
fp16=True,
|
60 |
#lr_scheduler_type='cosine',
|
61 |
-
save_steps=
|
62 |
save_total_limit=3,
|
63 |
)
|
64 |
# Check if a checkpoint exists and load it
|
@@ -69,7 +69,6 @@ def fine_tune_model(model_name, dataset_name, hub_id, api_key, num_epochs, batch
|
|
69 |
max_length = 128
|
70 |
try:
|
71 |
tokenized_train_dataset = load_from_disk(f'/data/{hub_id.strip()}_train_dataset')
|
72 |
-
print(tokenized_train_dataset[0])
|
73 |
tokenized_test_dataset = load_from_disk(f'/data/{hub_id.strip()}_test_dataset')
|
74 |
|
75 |
# Create Trainer
|
@@ -123,11 +122,6 @@ def fine_tune_model(model_name, dataset_name, hub_id, api_key, num_epochs, batch
|
|
123 |
compute_metrics=compute_metrics,
|
124 |
#callbacks=[LoggingCallback()],
|
125 |
)
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
|
132 |
# Fine-tune the model
|
133 |
trainer.train()
|
|
|
58 |
hub_model_id=hub_id.strip(),
|
59 |
fp16=True,
|
60 |
#lr_scheduler_type='cosine',
|
61 |
+
save_steps=100, # Save checkpoint every 500 steps
|
62 |
save_total_limit=3,
|
63 |
)
|
64 |
# Check if a checkpoint exists and load it
|
|
|
69 |
max_length = 128
|
70 |
try:
|
71 |
tokenized_train_dataset = load_from_disk(f'/data/{hub_id.strip()}_train_dataset')
|
|
|
72 |
tokenized_test_dataset = load_from_disk(f'/data/{hub_id.strip()}_test_dataset')
|
73 |
|
74 |
# Create Trainer
|
|
|
122 |
compute_metrics=compute_metrics,
|
123 |
#callbacks=[LoggingCallback()],
|
124 |
)
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
# Fine-tune the model
|
127 |
trainer.train()
|