Spaces:
Paused
Paused
Update app.py (#1)
Browse files- Update app.py (33e7c0575ab79e9f9c5cb511e84633eafff147d1)
app.py
CHANGED
|
@@ -200,42 +200,55 @@ PLACEHOLDER = """
|
|
| 200 |
</div>
|
| 201 |
"""
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
demo = gr.ChatInterface(
|
| 204 |
respond,
|
|
|
|
| 205 |
additional_inputs=[
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
label="Model"
|
| 214 |
-
),
|
| 215 |
-
gr.Textbox(value="You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem.", label="System message"),
|
| 216 |
-
gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens"),
|
| 217 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 218 |
-
gr.Slider(
|
| 219 |
-
minimum=0.1,
|
| 220 |
-
maximum=1.0,
|
| 221 |
-
value=0.95,
|
| 222 |
-
step=0.05,
|
| 223 |
-
label="Top-p",
|
| 224 |
-
),
|
| 225 |
-
gr.Slider(
|
| 226 |
-
minimum=0,
|
| 227 |
-
maximum=100,
|
| 228 |
-
value=40,
|
| 229 |
-
step=1,
|
| 230 |
-
label="Top-k",
|
| 231 |
-
),
|
| 232 |
-
gr.Slider(
|
| 233 |
-
minimum=0.0,
|
| 234 |
-
maximum=2.0,
|
| 235 |
-
value=1.1,
|
| 236 |
-
step=0.1,
|
| 237 |
-
label="Repetition penalty",
|
| 238 |
-
),
|
| 239 |
],
|
| 240 |
theme=gr.themes.Soft(primary_hue="violet", secondary_hue="violet", neutral_hue="gray",font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
| 241 |
body_background_fill_dark="#16141c",
|
|
@@ -256,11 +269,11 @@ demo = gr.ChatInterface(
|
|
| 256 |
clear_btn="Clear",
|
| 257 |
submit_btn="Send",
|
| 258 |
description="Llama-cpp-agent: Chat multi llm selection",
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
)
|
| 265 |
|
| 266 |
if __name__ == "__main__":
|
|
|
|
| 200 |
</div>
|
| 201 |
"""
|
| 202 |
|
| 203 |
+
# Definiere die Komponenten für die zusätzlichen Eingaben
|
| 204 |
+
# Diese müssen als Liste in 'additional_inputs' übergeben werden
|
| 205 |
+
model_dropdown = gr.Dropdown([
|
| 206 |
+
'granite-4.0-h-tiny-UD-Q3_K_XL.gguf',
|
| 207 |
+
'Llama-3.2-1B-Instruct-UD-Q2_K_XL.gguf',
|
| 208 |
+
'granite-4.0-h-small-UD-Q2_K_XL.gguf',
|
| 209 |
+
'UD-Q3_K_XL/GLM-4.5-Air-UD-Q3_K_XL-00001-of-00002.gguf'
|
| 210 |
+
],
|
| 211 |
+
value="granite-4.0-h-tiny-UD-Q3_K_XL.gguf",
|
| 212 |
+
label="Model"
|
| 213 |
+
)
|
| 214 |
+
|
| 215 |
+
system_textbox = gr.Textbox(value="You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem.", label="System message")
|
| 216 |
+
max_tokens_slider = gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens")
|
| 217 |
+
temperature_slider = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
|
| 218 |
+
top_p_slider = gr.Slider(
|
| 219 |
+
minimum=0.1,
|
| 220 |
+
maximum=1.0,
|
| 221 |
+
value=0.95,
|
| 222 |
+
step=0.05,
|
| 223 |
+
label="Top-p",
|
| 224 |
+
)
|
| 225 |
+
top_k_slider = gr.Slider(
|
| 226 |
+
minimum=0,
|
| 227 |
+
maximum=100,
|
| 228 |
+
value=40,
|
| 229 |
+
step=1,
|
| 230 |
+
label="Top-k",
|
| 231 |
+
)
|
| 232 |
+
repeat_penalty_slider = gr.Slider(
|
| 233 |
+
minimum=0.0,
|
| 234 |
+
maximum=2.0,
|
| 235 |
+
value=1.1,
|
| 236 |
+
step=0.1,
|
| 237 |
+
label="Repetition penalty",
|
| 238 |
+
)
|
| 239 |
+
|
| 240 |
+
|
| 241 |
demo = gr.ChatInterface(
|
| 242 |
respond,
|
| 243 |
+
# Übergabe der Komponenten als Liste
|
| 244 |
additional_inputs=[
|
| 245 |
+
model_dropdown,
|
| 246 |
+
system_textbox,
|
| 247 |
+
max_tokens_slider,
|
| 248 |
+
temperature_slider,
|
| 249 |
+
top_p_slider,
|
| 250 |
+
top_k_slider,
|
| 251 |
+
repeat_penalty_slider
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
],
|
| 253 |
theme=gr.themes.Soft(primary_hue="violet", secondary_hue="violet", neutral_hue="gray",font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
| 254 |
body_background_fill_dark="#16141c",
|
|
|
|
| 269 |
clear_btn="Clear",
|
| 270 |
submit_btn="Send",
|
| 271 |
description="Llama-cpp-agent: Chat multi llm selection",
|
| 272 |
+
# Die Platzhalter-Anzeige für den Chatbot wird jetzt direkt über 'chatbot_placeholder' oder
|
| 273 |
+
# über die 'placeholder' Eigenschaft des ChatInterfaces (wie hier) gesetzt,
|
| 274 |
+
# nicht mehr durch ein gr.Chatbot Objekt.
|
| 275 |
+
placeholder=PLACEHOLDER,
|
| 276 |
+
# Der Parameter chatbot wird nicht mehr verwendet
|
| 277 |
)
|
| 278 |
|
| 279 |
if __name__ == "__main__":
|