Spaces:
Runtime error
Runtime error
Bob Page
commited on
Commit
•
c5b4462
1
Parent(s):
4d35477
wip
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from langchain.vectorstores import Chroma
|
|
8 |
from langchain.chains import RetrievalQA
|
9 |
import os
|
10 |
|
11 |
-
os.environ["HUGGINGFACEHUB_API_TOKEN"] = ""
|
12 |
|
13 |
|
14 |
def file_upload_click(pdf_doc):
|
@@ -32,7 +32,6 @@ def bot(history):
|
|
32 |
query=history[-1][0]
|
33 |
response = qa({"query": query})
|
34 |
history[-1][1] = response['result']
|
35 |
-
print(history)
|
36 |
return history
|
37 |
|
38 |
|
@@ -44,9 +43,10 @@ with gr.Blocks() as demo:
|
|
44 |
question = gr.Textbox(label="Question", placeholder="Type your question and click submit")
|
45 |
submit_btn = gr.Button("Send message")
|
46 |
file_upload_button.click(file_upload_click, inputs=[file_upload], outputs=[status_label], queue=False)
|
47 |
-
submit_btn.click(add_text, [chatbot, question], [chatbot, question]).then(
|
48 |
bot, chatbot, chatbot
|
49 |
)
|
50 |
|
51 |
|
52 |
-
demo.queue()
|
|
|
|
8 |
from langchain.chains import RetrievalQA
|
9 |
import os
|
10 |
|
11 |
+
#os.environ["HUGGINGFACEHUB_API_TOKEN"] = ""
|
12 |
|
13 |
|
14 |
def file_upload_click(pdf_doc):
|
|
|
32 |
query=history[-1][0]
|
33 |
response = qa({"query": query})
|
34 |
history[-1][1] = response['result']
|
|
|
35 |
return history
|
36 |
|
37 |
|
|
|
43 |
question = gr.Textbox(label="Question", placeholder="Type your question and click submit")
|
44 |
submit_btn = gr.Button("Send message")
|
45 |
file_upload_button.click(file_upload_click, inputs=[file_upload], outputs=[status_label], queue=False)
|
46 |
+
submit_btn.click(add_text, [chatbot, question], [chatbot, question], queue=False).then(
|
47 |
bot, chatbot, chatbot
|
48 |
)
|
49 |
|
50 |
|
51 |
+
demo.queue()
|
52 |
+
demo.launch()
|