ariankhalfani commited on
Commit
5e6a1f4
1 Parent(s): 7a74a12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -183,6 +183,8 @@ def append_patient_info_to_html(name, age, medical_record, sex, result, predicte
183
 
184
  with open(html_db_file, 'a') as f:
185
  f.write(html_entry)
 
 
186
 
187
  # Function to download the folders
188
  def download_folder(folder):
@@ -244,9 +246,9 @@ with gr.Blocks() as demo:
244
 
245
  # Connect functions with components
246
  submit_btn.click(fn=interface, inputs=[name, age, medical_record, sex, input_image], outputs=[output_image, raw_result])
247
- download_html_btn.click(fn=save_patient_info_to_html, inputs=[name, age, medical_record, sex, raw_result], outputs=patient_info_file)
248
  download_uploaded_btn.click(fn=download_uploaded_folder, outputs=uploaded_folder_file)
249
  download_predicted_btn.click(fn=download_predicted_folder, outputs=predicted_folder_file)
250
-
251
  # Launch Gradio app
252
  demo.launch()
 
183
 
184
  with open(html_db_file, 'a') as f:
185
  f.write(html_entry)
186
+
187
+ return str(html_db_file) # Return the HTML file path for download
188
 
189
  # Function to download the folders
190
  def download_folder(folder):
 
246
 
247
  # Connect functions with components
248
  submit_btn.click(fn=interface, inputs=[name, age, medical_record, sex, input_image], outputs=[output_image, raw_result])
249
+ download_html_btn.click(fn=append_patient_info_to_html, inputs=[name, age, medical_record, sex, raw_result], outputs=patient_info_file)
250
  download_uploaded_btn.click(fn=download_uploaded_folder, outputs=uploaded_folder_file)
251
  download_predicted_btn.click(fn=download_predicted_folder, outputs=predicted_folder_file)
252
+
253
  # Launch Gradio app
254
  demo.launch()