Kevin Fink commited on
Commit
3c24b96
·
1 Parent(s): d06ead9
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -51,7 +51,7 @@ def fine_tune_model(model_name, dataset_name, hub_id, api_key, num_epochs, batch
51
  save_strategy='epoch',
52
  learning_rate=lr*0.00001,
53
  per_device_train_batch_size=int(batch_size),
54
- per_device_eval_batch_size=int(batch_size),
55
  num_train_epochs=int(num_epochs),
56
  weight_decay=0.01,
57
  gradient_accumulation_steps=grad*0.1,
@@ -63,7 +63,7 @@ def fine_tune_model(model_name, dataset_name, hub_id, api_key, num_epochs, batch
63
  #push_to_hub=True,
64
  hub_model_id=hub_id.strip(),
65
  #fp16=True,
66
- lr_scheduler_type='cosine',
67
  )
68
 
69
  # Create Trainer
@@ -99,10 +99,10 @@ try:
99
  gr.Textbox(label="Dataset Name (e.g., 'imdb')"),
100
  gr.Textbox(label="HF hub to push to after training"),
101
  gr.Textbox(label="HF API token"),
102
- gr.Slider(minimum=1, maximum=10, value=3, label="Number of Epochs"),
103
- gr.Slider(minimum=1, maximum=16, value=4, label="Batch Size"),
104
- gr.Slider(minimum=1, maximum=1000, value=50, label="Learning Rate (e-5)"),
105
- gr.Slider(minimum=1, maximum=100, value=1, label="Gradient accumulation (e-1)"),
106
  ],
107
  outputs="text",
108
  title="Fine-Tune Hugging Face Model",
 
51
  save_strategy='epoch',
52
  learning_rate=lr*0.00001,
53
  per_device_train_batch_size=int(batch_size),
54
+ per_device_eval_batch_size=1,
55
  num_train_epochs=int(num_epochs),
56
  weight_decay=0.01,
57
  gradient_accumulation_steps=grad*0.1,
 
63
  #push_to_hub=True,
64
  hub_model_id=hub_id.strip(),
65
  #fp16=True,
66
+ #lr_scheduler_type='cosine',
67
  )
68
 
69
  # Create Trainer
 
99
  gr.Textbox(label="Dataset Name (e.g., 'imdb')"),
100
  gr.Textbox(label="HF hub to push to after training"),
101
  gr.Textbox(label="HF API token"),
102
+ gr.Slider(minimum=1, maximum=10, value=3, label="Number of Epochs", step=1),
103
+ gr.Slider(minimum=1, maximum=16, value=4, label="Batch Size", step=1),
104
+ gr.Slider(minimum=1, maximum=1000, value=50, label="Learning Rate (e-5)", step=1),
105
+ gr.Slider(minimum=1, maximum=100, value=1, label="Gradient accumulation (e-1)", step=1),
106
  ],
107
  outputs="text",
108
  title="Fine-Tune Hugging Face Model",