init
Browse files
training_scripts/finetune_t5.py
CHANGED
@@ -163,16 +163,15 @@ def train(
|
|
163 |
)
|
164 |
# train
|
165 |
result = trainer.train()
|
166 |
-
trainer.
|
167 |
-
|
168 |
-
trainer.log_metrics("train", metrics)
|
169 |
-
trainer.save_metrics("train", metrics)
|
170 |
-
trainer.save_state()
|
171 |
# evaluate
|
172 |
metrics = trainer.evaluate()
|
173 |
trainer.log_metrics("eval", metrics)
|
174 |
trainer.save_metrics("eval", metrics)
|
175 |
# clean up memory
|
|
|
|
|
176 |
del trainer
|
177 |
del model
|
178 |
gc.collect()
|
|
|
163 |
)
|
164 |
# train
|
165 |
result = trainer.train()
|
166 |
+
trainer.log_metrics("train", result.metrics)
|
167 |
+
trainer.save_metrics("train", result.metrics)
|
|
|
|
|
|
|
168 |
# evaluate
|
169 |
metrics = trainer.evaluate()
|
170 |
trainer.log_metrics("eval", metrics)
|
171 |
trainer.save_metrics("eval", metrics)
|
172 |
# clean up memory
|
173 |
+
trainer.save_model()
|
174 |
+
trainer.save_state()
|
175 |
del trainer
|
176 |
del model
|
177 |
gc.collect()
|