Kevin Fink commited on
Commit
e643487
·
1 Parent(s): 506a330
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -23,7 +23,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained('google/t5-efficient-tiny', num_la
23
  model = get_peft_model(model, lora_config)
24
  model.gradient_checkpointing_enable()
25
 
26
- @spaces.GPU(duration=120)
27
  def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
28
  try:
29
  def compute_metrics(eval_pred):
@@ -141,6 +141,7 @@ def predict(text):
141
  return predictions.item()
142
  '''
143
 
 
144
  def run_train(dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
145
  result = fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad)
146
  return result
 
23
  model = get_peft_model(model, lora_config)
24
  model.gradient_checkpointing_enable()
25
 
26
+
27
  def fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
28
  try:
29
  def compute_metrics(eval_pred):
 
141
  return predictions.item()
142
  '''
143
 
144
+ @spaces.GPU(duration=120)
145
  def run_train(dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad):
146
  result = fine_tune_model(model, dataset_name, hub_id, api_key, num_epochs, batch_size, lr, grad)
147
  return result