Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
101 |
-
|
102 |
-
|
|
|
|
|
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,
|