mkaramb commited on
Commit
330c121
·
verified ·
1 Parent(s): d87076f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -184,13 +184,18 @@ def process_images(uploaded_file):
184
  # Return HTML and the path to the CSV file
185
  return html_output, temp_file.name
186
 
187
- interface = gr.Interface(
188
- fn=process_images,
189
- inputs="file",
190
- outputs=["html", "file"],
191
- title="Document AI Translation",
192
- description="Upload a ZIP file containing JPEG/JPG images, and the system will extract and translate text from each image.",
193
- )
 
 
 
 
 
194
 
195
  if __name__ == "__main__":
196
  interface.launch()
 
184
  # Return HTML and the path to the CSV file
185
  return html_output, temp_file.name
186
 
187
+ with gr.Blocks() as interface:
188
+ with gr.Row():
189
+ gr.Markdown("# Document AI Translation")
190
+ gr.Markdown("Upload a ZIP file containing JPEG/JPG images, and the system will extract and translate text from each image.")
191
+ with gr.Row():
192
+ file_input = gr.File(label="Upload ZIP File")
193
+ with gr.Row():
194
+ html_output = gr.HTML()
195
+ with gr.Row():
196
+ file_output = gr.File()
197
+
198
+ file_input.change(process_images, inputs=file_input, outputs=[html_output, file_output])
199
 
200
  if __name__ == "__main__":
201
  interface.launch()