Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,7 @@ import os
|
|
5 |
ACCESS_TOKEN = os.getenv("HF_TOKEN")
|
6 |
|
7 |
def show_loading_status(msg):
|
8 |
-
|
9 |
-
This helper function attempts to show a pop-up (toast) message if called
|
10 |
-
during an active Gradio event. If that fails, we at least log to console.
|
11 |
-
"""
|
12 |
try:
|
13 |
gr.toast(msg)
|
14 |
except:
|
@@ -44,8 +41,7 @@ def respond(
|
|
44 |
show_loading_status(f"Selected model (custom_model): {custom_model}")
|
45 |
|
46 |
# Convert seed to None if -1 (meaning random)
|
47 |
-
if seed
|
48 |
-
seed = None
|
49 |
|
50 |
messages = [{"role": "system", "content": system_message}]
|
51 |
show_loading_status("Initial messages array constructed.")
|
@@ -143,7 +139,7 @@ frequency_penalty_slider = gr.Slider(
|
|
143 |
)
|
144 |
seed_slider = gr.Slider(
|
145 |
minimum=-1,
|
146 |
-
maximum=
|
147 |
value=-1,
|
148 |
step=1,
|
149 |
label="Seed (-1 for random)"
|
@@ -192,17 +188,12 @@ with demo:
|
|
192 |
"meta-llama/Llama-3.2-1B-Instruct",
|
193 |
"meta-llama/Llama-3.1-8B-Instruct",
|
194 |
"NousResearch/Hermes-3-Llama-3.1-8B",
|
195 |
-
"google/gemma-2-27b-it",
|
196 |
-
"google/gemma-2-9b-it",
|
197 |
-
"google/gemma-2-2b-it",
|
198 |
"mistralai/Mistral-Nemo-Instruct-2407",
|
199 |
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
200 |
"mistralai/Mistral-7B-Instruct-v0.3",
|
201 |
"Qwen/Qwen2.5-72B-Instruct",
|
202 |
"Qwen/QwQ-32B-Preview",
|
203 |
-
"PowerInfer/SmallThinker-3B-Preview",
|
204 |
"HuggingFaceTB/SmolLM2-1.7B-Instruct",
|
205 |
-
"TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
206 |
"microsoft/Phi-3.5-mini-instruct",
|
207 |
]
|
208 |
show_loading_status("Models list initialized.")
|
|
|
5 |
ACCESS_TOKEN = os.getenv("HF_TOKEN")
|
6 |
|
7 |
def show_loading_status(msg):
|
8 |
+
|
|
|
|
|
|
|
9 |
try:
|
10 |
gr.toast(msg)
|
11 |
except:
|
|
|
41 |
show_loading_status(f"Selected model (custom_model): {custom_model}")
|
42 |
|
43 |
# Convert seed to None if -1 (meaning random)
|
44 |
+
seed = seed if seed != -1 else random.randint(1, 1000000000),
|
|
|
45 |
|
46 |
messages = [{"role": "system", "content": system_message}]
|
47 |
show_loading_status("Initial messages array constructed.")
|
|
|
139 |
)
|
140 |
seed_slider = gr.Slider(
|
141 |
minimum=-1,
|
142 |
+
maximum=1000000000,
|
143 |
value=-1,
|
144 |
step=1,
|
145 |
label="Seed (-1 for random)"
|
|
|
188 |
"meta-llama/Llama-3.2-1B-Instruct",
|
189 |
"meta-llama/Llama-3.1-8B-Instruct",
|
190 |
"NousResearch/Hermes-3-Llama-3.1-8B",
|
|
|
|
|
|
|
191 |
"mistralai/Mistral-Nemo-Instruct-2407",
|
192 |
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
193 |
"mistralai/Mistral-7B-Instruct-v0.3",
|
194 |
"Qwen/Qwen2.5-72B-Instruct",
|
195 |
"Qwen/QwQ-32B-Preview",
|
|
|
196 |
"HuggingFaceTB/SmolLM2-1.7B-Instruct",
|
|
|
197 |
"microsoft/Phi-3.5-mini-instruct",
|
198 |
]
|
199 |
show_loading_status("Models list initialized.")
|