Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,34 +103,6 @@ def render_first(pdf_file):
|
|
| 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,
|
| 117 |
-
# inputs=[chatbot, txt],
|
| 118 |
-
# outputs=[chatbot],
|
| 119 |
-
# queue=False
|
| 120 |
-
# ).success(
|
| 121 |
-
# fn=generate_response,
|
| 122 |
-
# inputs=[chatbot, txt, btn],
|
| 123 |
-
# outputs=[chatbot, txt]
|
| 124 |
-
# ).success(
|
| 125 |
-
# fn=render_file,
|
| 126 |
-
# inputs=[btn],
|
| 127 |
-
# outputs=[show_img]
|
| 128 |
-
# )
|
| 129 |
-
# demo.queue()
|
| 130 |
-
# if __name__ == "__main__":
|
| 131 |
-
# demo.launch()
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
with gr.Blocks() as demo:
|
| 136 |
with gr.Column():
|
|
@@ -154,6 +126,8 @@ with gr.Blocks() as demo:
|
|
| 154 |
change_api_key.click(fn=enable_api_box, outputs=[enable_box])
|
| 155 |
pdf_upload.upload(fn=render_first, inputs=[pdf_upload], outputs=[show_img]) # Corrected
|
| 156 |
|
|
|
|
|
|
|
| 157 |
submit_btn = gr.Button('Submit') # Added the Submit button
|
| 158 |
submit_btn.click(
|
| 159 |
fn=add_text,
|
|
|
|
| 103 |
# ... Generate the first image
|
| 104 |
return image
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
with gr.Blocks() as demo:
|
| 108 |
with gr.Column():
|
|
|
|
| 126 |
change_api_key.click(fn=enable_api_box, outputs=[enable_box])
|
| 127 |
pdf_upload.upload(fn=render_first, inputs=[pdf_upload], outputs=[show_img]) # Corrected
|
| 128 |
|
| 129 |
+
|
| 130 |
+
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...") # Add Textbox
|
| 131 |
submit_btn = gr.Button('Submit') # Added the Submit button
|
| 132 |
submit_btn.click(
|
| 133 |
fn=add_text,
|