bstraehle commited on
Commit
92146e5
1 Parent(s): bdec48e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -15,14 +15,17 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
15
 
16
  profile = "bstraehle"
17
 
18
- def download_model(model_id)
19
  tokenizer = AutoTokenizer.from_pretrained(model_id)
20
  model = AutoModelForCausalLM.from_pretrained(model_id)
21
  model.save_pretrained(model_id)
22
 
23
  return tokenizer
24
 
25
- def upload_model(model_id, tokenizer)
 
 
 
26
  model_name = model_id[model_id.rfind('/')+1:]
27
  print(model_name)
28
  model_repo_name = f"{profile}/{model_name}"
@@ -42,7 +45,7 @@ def process(model_id, dataset):
42
  tokenizer = download_model(model_id)
43
  upload_model(model_id, tokenizer)
44
 
45
- return "Done"
46
 
47
  demo = gr.Interface(fn=process,
48
  inputs=[gr.Textbox(label = "Model ID", value = "meta-llama/Meta-Llama-3-8B-Instruct", lines = 1),
 
15
 
16
  profile = "bstraehle"
17
 
18
+ def download_model(model_id):
19
  tokenizer = AutoTokenizer.from_pretrained(model_id)
20
  model = AutoModelForCausalLM.from_pretrained(model_id)
21
  model.save_pretrained(model_id)
22
 
23
  return tokenizer
24
 
25
+ def fine_tune:
26
+ return ""
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}"
 
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),