Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -99,16 +99,18 @@ async def respond(message, history, system_message, max_tokens, temperature, top
|
|
99 |
yield f"⚠️ Medical system error: {str(e)}"
|
100 |
|
101 |
# ------ Enhanced Gradio Interface ------
|
|
|
102 |
demo = gr.ChatInterface(
|
103 |
respond,
|
104 |
additional_inputs=[
|
105 |
gr.Textbox(value="Medical diagnosis assistant", label="System Role"),
|
106 |
-
gr.Slider(512,
|
107 |
-
gr.Slider(0.1,
|
108 |
-
gr.Slider(0.
|
109 |
-
]
|
110 |
-
|
111 |
-
).queue(concurrency_count=5) # Improved throughput [1]
|
112 |
|
113 |
if __name__ == "__main__":
|
114 |
-
demo.launch(
|
|
|
|
|
|
99 |
yield f"⚠️ Medical system error: {str(e)}"
|
100 |
|
101 |
# ------ Enhanced Gradio Interface ------
|
102 |
+
# ------ Gradio Interface ------
|
103 |
demo = gr.ChatInterface(
|
104 |
respond,
|
105 |
additional_inputs=[
|
106 |
gr.Textbox(value="Medical diagnosis assistant", label="System Role"),
|
107 |
+
gr.Slider(512, 2048, value=512, step=128, label="Max Tokens"),
|
108 |
+
gr.Slider(0.1, 2.0, value=0.7, step=0.1, label="Temperature"),
|
109 |
+
gr.Slider(0.5, 1.0, value=0.95, step=0.05, label="Top-p")
|
110 |
+
]
|
111 |
+
).queue(concurrency_limit=5) # Updated concurrency handling
|
|
|
112 |
|
113 |
if __name__ == "__main__":
|
114 |
+
demo.launch(max_threads=10) # Add thread pool configuration
|
115 |
+
|
116 |
+
|