Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,6 +94,8 @@ with st.container():
|
|
| 94 |
""")
|
| 95 |
|
| 96 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
| 97 |
# ... (rest of your interface creation)
|
| 98 |
|
| 99 |
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...")
|
|
@@ -102,17 +104,18 @@ with st.container():
|
|
| 102 |
@submit_btn.click()
|
| 103 |
def on_submit():
|
| 104 |
add_text(chatbot, txt)
|
| 105 |
-
generate_response(chatbot, txt, pdf_upload1)
|
| 106 |
-
render_file(pdf_upload1)
|
| 107 |
|
| 108 |
if __name__ == "__main__":
|
| 109 |
gr.Interface(
|
| 110 |
[render_first, add_text, generate_response, render_file],
|
| 111 |
-
[pdf_upload1, chatbot, txt,
|
| 112 |
[show_img, chatbot, txt],
|
| 113 |
title="PDF-Powered Chatbot"
|
| 114 |
).launch()
|
| 115 |
|
|
|
|
| 116 |
|
| 117 |
|
| 118 |
|
|
|
|
| 94 |
""")
|
| 95 |
|
| 96 |
with gr.Blocks() as demo:
|
| 97 |
+
pdf_upload1 = gr.UploadButton("📁 Upload PDF 1", file_types=[".pdf"]) # Define pdf_upload1
|
| 98 |
+
|
| 99 |
# ... (rest of your interface creation)
|
| 100 |
|
| 101 |
txt = gr.Textbox(label="Enter your query", placeholder="Ask a question...")
|
|
|
|
| 104 |
@submit_btn.click()
|
| 105 |
def on_submit():
|
| 106 |
add_text(chatbot, txt)
|
| 107 |
+
generate_response(chatbot, txt, pdf_upload1) # Use pdf_upload1 here
|
| 108 |
+
render_file(pdf_upload1) # Use pdf_upload1 here
|
| 109 |
|
| 110 |
if __name__ == "__main__":
|
| 111 |
gr.Interface(
|
| 112 |
[render_first, add_text, generate_response, render_file],
|
| 113 |
+
[pdf_upload1, chatbot, txt], # Include pdf_upload1 here
|
| 114 |
[show_img, chatbot, txt],
|
| 115 |
title="PDF-Powered Chatbot"
|
| 116 |
).launch()
|
| 117 |
|
| 118 |
+
|
| 119 |
|
| 120 |
|
| 121 |
|