Amitontheweb commited on
Commit
8a84d8a
·
verified ·
1 Parent(s): df913ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -160,14 +160,14 @@ def select_model(model_selected):
160
 
161
  # On clicking load button
162
 
163
- def load_model ():
164
 
165
  global model_name
166
  global tokenizer
167
  global model
168
 
169
- tokenizer = AutoTokenizer.from_pretrained(model_name)
170
- model = AutoModelForCausalLM.from_pretrained(model_name)
171
 
172
 
173
 
@@ -329,7 +329,7 @@ with gr.Blocks() as demo:
329
 
330
  with gr.Column (scale=0, min_width=200) as Models_Strategy:
331
 
332
- model_selected = gr.Radio (["GPT2", "Qwen2"], label="ML Model", value="GPT2")
333
  load_model_button = gr.Button("Load")
334
  strategy_selected = gr.Radio (["Sampling", "Beam Search", "Diversity Beam Search","Contrastive"], label="Search strategy", value = "Sampling", interactive=True)
335
 
 
160
 
161
  # On clicking load button
162
 
163
+ def load_model (name):
164
 
165
  global model_name
166
  global tokenizer
167
  global model
168
 
169
+ tokenizer = AutoTokenizer.from_pretrained(name)
170
+ model = AutoModelForCausalLM.from_pretrained(name)
171
 
172
 
173
 
 
329
 
330
  with gr.Column (scale=0, min_width=200) as Models_Strategy:
331
 
332
+ model_selected = gr.Radio (["GPT2", "Qwen/Qwen2-0.5B"], label="ML Model", value="GPT2")
333
  load_model_button = gr.Button("Load")
334
  strategy_selected = gr.Radio (["Sampling", "Beam Search", "Diversity Beam Search","Contrastive"], label="Search strategy", value = "Sampling", interactive=True)
335