Nikhil0987 commited on
Commit
165a6d7
Β·
verified Β·
1 Parent(s): c6446da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -97,10 +97,20 @@ with gr.Blocks() as demo:
97
  # Event handler for changing the API key
98
  change_api_key.click(fn=enable_api_box, outputs=[enable_box])
99
 
100
- # Event handler for uploading a PDF
101
- pdf_upload = gr.UploadButton("πŸ“ Upload a PDF", file_types=[".pdf"])
102
- pdf_upload.upload(fn=render_first, inputs=[pdf_upload], outputs=[show_img])
 
 
103
 
 
 
 
 
 
 
 
 
104
  # Event handler for submitting text and generating response
105
  submit_btn.click(
106
  fn=add_text,
 
97
  # Event handler for changing the API key
98
  change_api_key.click(fn=enable_api_box, outputs=[enable_box])
99
 
100
+
101
+ def render_first(pdf_file):
102
+ # ... Logic to process the PDF
103
+ # ... Generate the first image
104
+ return image
105
 
106
+ with gr.Blocks() as demo:
107
+ # ... your UI setup ...
108
+
109
+ pdf_upload = gr.UploadButton("πŸ“ Upload a PDF", file_types=[".pdf"])
110
+
111
+ # ... other event handlers ...
112
+
113
+ pdf_upload.upload(fn=render_first, inputs=[pdf_upload], outputs=[show_img])
114
  # Event handler for submitting text and generating response
115
  submit_btn.click(
116
  fn=add_text,