AAA1988 commited on
Commit
70b6bd2
·
verified ·
1 Parent(s): b421380

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
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, 1024, value=512, step=128, label="Max Tokens"),
107
- gr.Slider(0.1, 1.0, value=0.5, step=0.1, label="Temperature"),
108
- gr.Slider(0.7, 1.0, value=0.9, step=0.05, label="Top-p")
109
- ],
110
- examples=[["Headache and fever"], ["Chest pain radiating to arm"]]
111
- ).queue(concurrency_count=5) # Improved throughput [1]
112
 
113
  if __name__ == "__main__":
114
- demo.launch(server_port=7860, share=True)
 
 
 
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
+