Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,15 +119,15 @@ with st.container():
|
|
| 119 |
|
| 120 |
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...")
|
| 121 |
submit_btn = gr.Button('Submit')
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
|
| 132 |
if __name__ == "__main__":
|
| 133 |
gr.Interface(
|
|
@@ -135,16 +135,5 @@ if __name__ == "__main__":
|
|
| 135 |
[pdf_upload1, chatbot, txt, pdf_upload2, pdf_upload3],
|
| 136 |
[show_img, chatbot, txt], # Assuming you want to display initially
|
| 137 |
title="PDF-Powered Chatbot"
|
| 138 |
-
).launch()
|
| 139 |
-
|
| 140 |
-
# Modified Event Handlers
|
| 141 |
-
submit_btn.click(
|
| 142 |
-
fn=add_text, inputs=[chatbot, txt], outputs=[chatbot], queue=False
|
| 143 |
-
)
|
| 144 |
-
chatbot.change(
|
| 145 |
-
fn=generate_response, inputs=[chatbot, txt, pdf_upload1], outputs=[chatbot, txt]
|
| 146 |
-
)
|
| 147 |
-
txt.change(
|
| 148 |
-
fn=render_file, inputs=[pdf_upload1], outputs=[show_img]
|
| 149 |
-
)
|
| 150 |
|
|
|
|
| 119 |
|
| 120 |
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...")
|
| 121 |
submit_btn = gr.Button('Submit')
|
| 122 |
+
|
| 123 |
+
submit_btn.click(
|
| 124 |
+
fn=add_text, inputs=[chatbot, txt], outputs=[chatbot], queue=False
|
| 125 |
+
).success(
|
| 126 |
+
# How do you want to use the different uploads here?
|
| 127 |
+
fn=generate_response, inputs=[chatbot, txt, pdf_upload1], outputs=[chatbot, txt]
|
| 128 |
+
).success(
|
| 129 |
+
fn=render_file, inputs=[pdf_upload1], outputs=[show_img]
|
| 130 |
+
)
|
| 131 |
|
| 132 |
if __name__ == "__main__":
|
| 133 |
gr.Interface(
|
|
|
|
| 135 |
[pdf_upload1, chatbot, txt, pdf_upload2, pdf_upload3],
|
| 136 |
[show_img, chatbot, txt], # Assuming you want to display initially
|
| 137 |
title="PDF-Powered Chatbot"
|
| 138 |
+
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|