Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
170 |
-
model = AutoModelForCausalLM.from_pretrained(
|
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 |
|