Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,12 +119,14 @@ with st.container():
|
|
| 119 |
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...")
|
| 120 |
submit_btn = gr.Button('Submit')
|
| 121 |
|
| 122 |
-
#
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
generate_response
|
| 127 |
-
|
|
|
|
|
|
|
| 128 |
|
| 129 |
if __name__ == "__main__":
|
| 130 |
gr.Interface(
|
|
@@ -134,4 +136,5 @@ if __name__ == "__main__":
|
|
| 134 |
title="PDF-Powered Chatbot"
|
| 135 |
).launch()
|
| 136 |
|
|
|
|
| 137 |
|
|
|
|
| 119 |
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...")
|
| 120 |
submit_btn = gr.Button('Submit')
|
| 121 |
|
| 122 |
+
# Event handler for submit button
|
| 123 |
+
submit_btn.click(
|
| 124 |
+
fn=add_text, inputs=[chatbot, txt], outputs=[chatbot], queue=False
|
| 125 |
+
).success(
|
| 126 |
+
fn=generate_response, inputs=[chatbot, txt, pdf_upload1], outputs=[chatbot, txt]
|
| 127 |
+
).success(
|
| 128 |
+
fn=render_file, inputs=[pdf_upload1], outputs=[show_img]
|
| 129 |
+
)
|
| 130 |
|
| 131 |
if __name__ == "__main__":
|
| 132 |
gr.Interface(
|
|
|
|
| 136 |
title="PDF-Powered Chatbot"
|
| 137 |
).launch()
|
| 138 |
|
| 139 |
+
|
| 140 |
|