nagasurendra commited on
Commit
2552b80
·
verified ·
1 Parent(s): 5fc5e6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -106,16 +106,19 @@ def generate_dpr(files):
106
  # Save DPR text to PDF
107
  pdf_result = save_dpr_to_pdf(dpr_output, pdf_filename)
108
 
109
- # Return the DPR text and PDF save status
110
- return f"{dpr_output}\n\n{pdf_result}"
111
 
112
- # Gradio interface for uploading multiple files and displaying the text-based DPR
113
  iface = gr.Interface(
114
  fn=generate_dpr,
115
  inputs=gr.Files(type="filepath", label="Upload Site Photos"), # Handle batch upload of images
116
- outputs="text", # Display the DPR as text in the output section
 
 
 
117
  title="Daily Progress Report Generator",
118
- description="Upload up to 10 site photos. The AI model will dynamically detect construction activities, materials, and progress and generate a text-based Daily Progress Report (DPR). The DPR will also be saved as a PDF.",
119
  allow_flagging="never" # Optional: Disable flagging
120
  )
121
 
 
106
  # Save DPR text to PDF
107
  pdf_result = save_dpr_to_pdf(dpr_output, pdf_filename)
108
 
109
+ # Return the DPR text and the PDF file path for download
110
+ return dpr_output + f"\n\n{pdf_result}", pdf_filename
111
 
112
+ # Gradio interface for uploading multiple files, displaying DPR, and downloading PDF
113
  iface = gr.Interface(
114
  fn=generate_dpr,
115
  inputs=gr.Files(type="filepath", label="Upload Site Photos"), # Handle batch upload of images
116
+ outputs=[
117
+ gr.Textbox(label="Daily Progress Report"), # Display DPR text
118
+ gr.File(label="Download PDF") # Provide PDF download link
119
+ ],
120
  title="Daily Progress Report Generator",
121
+ description="Upload up to 10 site photos. The AI model will dynamically detect construction activities, materials, and progress and generate a text-based Daily Progress Report (DPR). The DPR will also be saved as a PDF, which you can download.",
122
  allow_flagging="never" # Optional: Disable flagging
123
  )
124