Kevin Fink
commited on
Commit
·
0ee2b72
1
Parent(s):
3aaa543
dev
Browse files
app.py
CHANGED
@@ -243,12 +243,12 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
|
|
243 |
|
244 |
checkpoint_dir = training_args.output_dir
|
245 |
# If the trainer_state.json is missing, look for the previous checkpoint
|
246 |
-
previous_checkpoints = sorted(os.listdir("/data/results"),
|
247 |
print(f'CHECKPOINTs: {previous_checkpoints}')
|
248 |
for check in previous_checkpoints:
|
249 |
try:
|
250 |
print(f"Removing previous checkpoint {check}")
|
251 |
-
shutil.rmtree(os.path.join('/data/results', check))
|
252 |
except:
|
253 |
pass
|
254 |
try:
|
|
|
243 |
|
244 |
checkpoint_dir = training_args.output_dir
|
245 |
# If the trainer_state.json is missing, look for the previous checkpoint
|
246 |
+
previous_checkpoints = sorted(os.listdir("/data/results/checkpoints"), reverse=True)
|
247 |
print(f'CHECKPOINTs: {previous_checkpoints}')
|
248 |
for check in previous_checkpoints:
|
249 |
try:
|
250 |
print(f"Removing previous checkpoint {check}")
|
251 |
+
shutil.rmtree(os.path.join('/data/results/checkpoints', check))
|
252 |
except:
|
253 |
pass
|
254 |
try:
|