Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -53,6 +53,7 @@ def choose_model(model_name):
|
|
53 |
elif model_name == "Llama-3.2-11B-Vision-Instruct":
|
54 |
model = "meta-llama/Llama-3.2-11B-Vision-Instruct"
|
55 |
mode = "image-to-text"
|
|
|
56 |
|
57 |
elif model_name == "Gemma-2-2b":
|
58 |
model = "google/gemma-2-2b-it"
|
@@ -71,7 +72,8 @@ def choose_model(model_name):
|
|
71 |
|
72 |
else: # default to zephyr if no model chosen
|
73 |
model = "HuggingFaceH4/zephyr-7b-beta"
|
74 |
-
|
|
|
75 |
return model
|
76 |
|
77 |
|
@@ -105,12 +107,11 @@ if mode == "text-to-text":
|
|
105 |
demo = gr.ChatInterface(
|
106 |
respond,
|
107 |
stop_btn = "Stop generation",
|
108 |
-
multimodal = True,
|
109 |
title="Ask me anything",
|
110 |
description="Hi there! I am your friendly AI chatbot. Choose from different language models under the Additional Inputs tab below.",
|
111 |
examples=[["Explain quantum computing"], ["Explain forex trading"], ["What is the capital of China?"], ["Make a poem about nature"]],
|
112 |
additional_inputs=[
|
113 |
-
gr.Dropdown(["DeepSeek-R1-Distill-Qwen-1.5B", "DeepSeek-R1-Distill-Qwen-32B", "Gemma-2-2b", "Gemma-7b", "Llama2-13b-chat", "Llama3-8b-Instruct", "Llama3.1-8b-Instruct", "Microsoft-phi-2", "Mixtral-8x7B-Instruct", "Qwen2.5-Coder-32B-Instruct", "Zephyr-7b-beta"], label="Select Model"),
|
114 |
gr.Textbox(value="You are a friendly and helpful Chatbot, be concise and straight to the point, avoid excessive reasoning.", label="System message"),
|
115 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
116 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
|
|
53 |
elif model_name == "Llama-3.2-11B-Vision-Instruct":
|
54 |
model = "meta-llama/Llama-3.2-11B-Vision-Instruct"
|
55 |
mode = "image-to-text"
|
56 |
+
return model
|
57 |
|
58 |
elif model_name == "Gemma-2-2b":
|
59 |
model = "google/gemma-2-2b-it"
|
|
|
72 |
|
73 |
else: # default to zephyr if no model chosen
|
74 |
model = "HuggingFaceH4/zephyr-7b-beta"
|
75 |
+
|
76 |
+
mode = "text-to-text"
|
77 |
return model
|
78 |
|
79 |
|
|
|
107 |
demo = gr.ChatInterface(
|
108 |
respond,
|
109 |
stop_btn = "Stop generation",
|
|
|
110 |
title="Ask me anything",
|
111 |
description="Hi there! I am your friendly AI chatbot. Choose from different language models under the Additional Inputs tab below.",
|
112 |
examples=[["Explain quantum computing"], ["Explain forex trading"], ["What is the capital of China?"], ["Make a poem about nature"]],
|
113 |
additional_inputs=[
|
114 |
+
gr.Dropdown(["DeepSeek-R1-Distill-Qwen-1.5B", "DeepSeek-R1-Distill-Qwen-32B", "Gemma-2-2b", "Gemma-7b", "Llama2-13b-chat", "Llama3-8b-Instruct", "Llama3.1-8b-Instruct", "Llama-3.2-11B-Vision-Instruct", "Microsoft-phi-2", "Mixtral-8x7B-Instruct", "Qwen2.5-Coder-32B-Instruct", "Zephyr-7b-beta"], label="Select Model"),
|
115 |
gr.Textbox(value="You are a friendly and helpful Chatbot, be concise and straight to the point, avoid excessive reasoning.", label="System message"),
|
116 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
117 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|