bstraehle commited on
Commit
2b03f9f
·
verified ·
1 Parent(s): e66c7c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -27,7 +27,6 @@ def fine_tune_model():
27
 
28
  def upload_model(model_id, tokenizer):
29
  model_name = model_id[model_id.rfind('/')+1:]
30
- print(model_name)
31
  model_repo_name = f"{profile}/{model_name}"
32
 
33
  login(token=os.environ["HF_TOKEN"])
@@ -40,12 +39,14 @@ def upload_model(model_id, tokenizer):
40
  )
41
 
42
  tokenizer.push_to_hub(model_repo_name)
43
-
 
 
44
  def process(model_id, dataset):
45
  tokenizer = download_model(model_id)
46
- upload_model(model_id, tokenizer)
47
 
48
- return "Processing completed"
49
 
50
  demo = gr.Interface(fn=process,
51
  inputs=[gr.Textbox(label = "Model ID", value = "meta-llama/Meta-Llama-3-8B-Instruct", lines = 1),
 
27
 
28
  def upload_model(model_id, tokenizer):
29
  model_name = model_id[model_id.rfind('/')+1:]
 
30
  model_repo_name = f"{profile}/{model_name}"
31
 
32
  login(token=os.environ["HF_TOKEN"])
 
39
  )
40
 
41
  tokenizer.push_to_hub(model_repo_name)
42
+
43
+ return model_repo_name
44
+
45
  def process(model_id, dataset):
46
  tokenizer = download_model(model_id)
47
+ model_repo_name = upload_model(model_id, tokenizer)
48
 
49
+ return model_repo_name
50
 
51
  demo = gr.Interface(fn=process,
52
  inputs=[gr.Textbox(label = "Model ID", value = "meta-llama/Meta-Llama-3-8B-Instruct", lines = 1),