Kevin Fink commited on
Commit
08c19d5
·
1 Parent(s): 8a2330b
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -64,8 +64,8 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
64
  per_device_eval_batch_size=int(batch_size),
65
  num_train_epochs=int(num_epochs),
66
  weight_decay=0.01,
67
- #gradient_accumulation_steps=int(grad),
68
- #max_grad_norm = 1.0,
69
  load_best_model_at_end=True,
70
  metric_for_best_model="accuracy",
71
  greater_is_better=True,
@@ -190,8 +190,8 @@ def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size
190
  return 'RUN AGAIN TO LOAD REST OF DATA'
191
 
192
  # Fine-tune the model
193
- if os.path.exists(training_args.output_dir) and os.listdir(training_args.output_dir):
194
- train_result = trainer.train(resume_from_checkpoint=True)
195
  else:
196
  train_result = trainer.train()
197
  trainer.push_to_hub(commit_message="Training complete!")
 
64
  per_device_eval_batch_size=int(batch_size),
65
  num_train_epochs=int(num_epochs),
66
  weight_decay=0.01,
67
+ gradient_accumulation_steps=int(grad),
68
+ max_grad_norm = 3.0,
69
  load_best_model_at_end=True,
70
  metric_for_best_model="accuracy",
71
  greater_is_better=True,
 
190
  return 'RUN AGAIN TO LOAD REST OF DATA'
191
 
192
  # Fine-tune the model
193
+ #if os.path.exists(training_args.output_dir) and os.listdir(training_args.output_dir):
194
+ #train_result = trainer.train(resume_from_checkpoint=True)
195
  else:
196
  train_result = trainer.train()
197
  trainer.push_to_hub(commit_message="Training complete!")