Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
·
ce667dc
1
Parent(s):
28743d9
with gr.Accordion
Browse files
app.py
CHANGED
@@ -316,14 +316,15 @@ def main():
|
|
316 |
# output = gr.Textbox(label="Output Box")
|
317 |
# greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
327 |
|
328 |
# interactive chat
|
329 |
chatbot = gr.Chatbot()
|
@@ -342,7 +343,7 @@ def main():
|
|
342 |
bot_message = f"{answer} ({docs})"
|
343 |
except Exception as exc:
|
344 |
logger.error(exc)
|
345 |
-
bot_message = f"{exc}"
|
346 |
|
347 |
chat_history.append((message, bot_message))
|
348 |
|
|
|
316 |
# output = gr.Textbox(label="Output Box")
|
317 |
# greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
|
318 |
|
319 |
+
with gr.Accordion("Upload files", open=True):
|
320 |
+
# Upload files and generate embeddings database
|
321 |
+
file_output = gr.File()
|
322 |
+
upload_button = gr.UploadButton(
|
323 |
+
"Click to upload files",
|
324 |
+
# file_types=["*.pdf", "*.epub", "*.docx"],
|
325 |
+
file_count="multiple",
|
326 |
+
)
|
327 |
+
upload_button.upload(upload_files, upload_button, file_output)
|
328 |
|
329 |
# interactive chat
|
330 |
chatbot = gr.Chatbot()
|
|
|
343 |
bot_message = f"{answer} ({docs})"
|
344 |
except Exception as exc:
|
345 |
logger.error(exc)
|
346 |
+
bot_message = f"bummer! {exc}"
|
347 |
|
348 |
chat_history.append((message, bot_message))
|
349 |
|