Ali2206 commited on
Commit
e57a7d0
·
verified ·
1 Parent(s): 72dc45e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -212,8 +212,13 @@ Upload clinical Excel records below and click **Analyze** to generate a medical
212
  report_file = gr.File(label="Download Report", visible=False)
213
  full_output = gr.State(value="")
214
 
 
 
 
 
 
215
  analyze_btn.click(
216
- fn=stream_report_wrapper(agent),
217
  inputs=[file_upload, full_output],
218
  outputs=[report_output_markdown, report_file, full_output]
219
  )
@@ -227,4 +232,4 @@ if __name__ == "__main__":
227
  demo.launch(server_name="0.0.0.0", server_port=7860, allowed_paths=["/data/hf_cache/reports"], share=False)
228
  except Exception as e:
229
  print(f"Error: {str(e)}")
230
- sys.exit(1)
 
212
  report_file = gr.File(label="Download Report", visible=False)
213
  full_output = gr.State(value="")
214
 
215
+ streaming_fn = stream_report_wrapper(agent)
216
+
217
+ def run_streaming(file, state):
218
+ return streaming_fn(file, state)
219
+
220
  analyze_btn.click(
221
+ fn=run_streaming,
222
  inputs=[file_upload, full_output],
223
  outputs=[report_output_markdown, report_file, full_output]
224
  )
 
232
  demo.launch(server_name="0.0.0.0", server_port=7860, allowed_paths=["/data/hf_cache/reports"], share=False)
233
  except Exception as e:
234
  print(f"Error: {str(e)}")
235
+ sys.exit(1)