Spaces:
Sleeping
Sleeping
use gradio 5
Browse files- app.py +5 -15
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -139,7 +139,7 @@ custom_theme = gr.themes.Soft(
|
|
| 139 |
)
|
| 140 |
|
| 141 |
# Build the Gradio interface
|
| 142 |
-
with gr.Blocks() as demo:
|
| 143 |
gr.Markdown(
|
| 144 |
"""
|
| 145 |
# 🤖 Smol LLM Inference GUI
|
|
@@ -235,14 +235,12 @@ with gr.Blocks() as demo:
|
|
| 235 |
repetition_penalty,
|
| 236 |
system_prompt
|
| 237 |
],
|
| 238 |
-
outputs=[output_text]
|
| 239 |
-
api_visibility="public"
|
| 240 |
)
|
| 241 |
|
| 242 |
clear_btn.click(
|
| 243 |
fn=clear_chat,
|
| 244 |
-
outputs=[prompt_input, output_text]
|
| 245 |
-
api_visibility="private"
|
| 246 |
)
|
| 247 |
|
| 248 |
# Allow Enter key to generate
|
|
@@ -256,8 +254,7 @@ with gr.Blocks() as demo:
|
|
| 256 |
repetition_penalty,
|
| 257 |
system_prompt
|
| 258 |
],
|
| 259 |
-
outputs=[output_text]
|
| 260 |
-
api_visibility="public"
|
| 261 |
)
|
| 262 |
|
| 263 |
# Auto-load the model at startup
|
|
@@ -266,13 +263,6 @@ print(f"Startup load status: {load_status}")
|
|
| 266 |
|
| 267 |
# Launch the application
|
| 268 |
demo.launch(
|
| 269 |
-
theme=custom_theme,
|
| 270 |
-
footer_links=[
|
| 271 |
-
{"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"},
|
| 272 |
-
{"label": "SmolLM2 Model", "url": "https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct"},
|
| 273 |
-
{"label": "Gradio", "url": "https://gradio.app"}
|
| 274 |
-
],
|
| 275 |
share=False,
|
| 276 |
-
show_error=True
|
| 277 |
-
ssr_mode=False
|
| 278 |
)
|
|
|
|
| 139 |
)
|
| 140 |
|
| 141 |
# Build the Gradio interface
|
| 142 |
+
with gr.Blocks(theme=custom_theme) as demo:
|
| 143 |
gr.Markdown(
|
| 144 |
"""
|
| 145 |
# 🤖 Smol LLM Inference GUI
|
|
|
|
| 235 |
repetition_penalty,
|
| 236 |
system_prompt
|
| 237 |
],
|
| 238 |
+
outputs=[output_text]
|
|
|
|
| 239 |
)
|
| 240 |
|
| 241 |
clear_btn.click(
|
| 242 |
fn=clear_chat,
|
| 243 |
+
outputs=[prompt_input, output_text]
|
|
|
|
| 244 |
)
|
| 245 |
|
| 246 |
# Allow Enter key to generate
|
|
|
|
| 254 |
repetition_penalty,
|
| 255 |
system_prompt
|
| 256 |
],
|
| 257 |
+
outputs=[output_text]
|
|
|
|
| 258 |
)
|
| 259 |
|
| 260 |
# Auto-load the model at startup
|
|
|
|
| 263 |
|
| 264 |
# Launch the application
|
| 265 |
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
share=False,
|
| 267 |
+
show_error=True
|
|
|
|
| 268 |
)
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
accelerate
|
| 2 |
torch
|
| 3 |
transformers
|
| 4 |
-
gradio
|
|
|
|
| 1 |
accelerate
|
| 2 |
torch
|
| 3 |
transformers
|
| 4 |
+
gradio==5.9.0
|