xen2003 commited on
Commit
6dcab24
·
verified ·
1 Parent(s): 864fcdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -17
app.py CHANGED
@@ -594,24 +594,8 @@ with gr.Blocks() as iface:
594
  </script>
595
  """)
596
 
597
-
598
  # Link the button clicks to the functions that handle them
599
- #download_button.click(fn=download_report_function, inputs=[], outputs=gr.File())
600
- # File output to provide a downloadable link
601
- #pdf_file = gr.File(label=report_path)
602
-
603
- # Click event to trigger file download
604
- download_button.click(fn=download_report_function, inputs=[], outputs=report_path)
605
-
606
- # Iframe to display the PDF inside Gradio
607
- pdf_display = gr.HTML("") # Placeholder
608
-
609
- # JavaScript to update the iframe when the button is clicked
610
- def show_pdf(report_path):
611
- return f"""<iframe src=report_path width='100%' height='600px'></iframe>"""
612
-
613
- # Update iframe when file is downloaded
614
- download_button.click(fn=show_pdf, inputs=[report_path], outputs=pdf_display)
615
 
616
  clear_button.click(
617
  fn=clear_function,
 
594
  </script>
595
  """)
596
 
 
597
  # Link the button clicks to the functions that handle them
598
+ download_button.click(fn=download_report_function, inputs=[], outputs=gr.File())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
 
600
  clear_button.click(
601
  fn=clear_function,