Spaces:
Runtime error
Runtime error
unknown commited on
Commit ·
17427f1
1
Parent(s): 78664d6
a1
Browse files
app.py
CHANGED
|
@@ -29,9 +29,10 @@ def chat(chat_history, user_input):
|
|
| 29 |
def upload_file(files):
|
| 30 |
file_paths = [file.name for file in files]
|
| 31 |
return file_paths
|
|
|
|
| 32 |
with gr.Blocks() as demo:
|
| 33 |
-
gr.Markdown('# Q&A
|
| 34 |
-
with gr.Tab("
|
| 35 |
file_output = gr.File()
|
| 36 |
upload_button=gr.UploadButton(file_types=[".pdf",".csv",".docx"])
|
| 37 |
upload_button.upload(upload_file, upload_button, file_output)
|
|
@@ -42,4 +43,5 @@ with gr.Blocks() as demo:
|
|
| 42 |
chatbot = gr.Chatbot()
|
| 43 |
message = gr.Textbox ("What is this document about?")
|
| 44 |
message.submit(chat, [chatbot, message], chatbot)
|
|
|
|
| 45 |
demo.queue().launch(debug = True)
|
|
|
|
| 29 |
def upload_file(files):
|
| 30 |
file_paths = [file.name for file in files]
|
| 31 |
return file_paths
|
| 32 |
+
|
| 33 |
with gr.Blocks() as demo:
|
| 34 |
+
gr.Markdown('# Q&A with your own files')
|
| 35 |
+
with gr.Tab("Document"):
|
| 36 |
file_output = gr.File()
|
| 37 |
upload_button=gr.UploadButton(file_types=[".pdf",".csv",".docx"])
|
| 38 |
upload_button.upload(upload_file, upload_button, file_output)
|
|
|
|
| 43 |
chatbot = gr.Chatbot()
|
| 44 |
message = gr.Textbox ("What is this document about?")
|
| 45 |
message.submit(chat, [chatbot, message], chatbot)
|
| 46 |
+
|
| 47 |
demo.queue().launch(debug = True)
|