Spaces:
Runtime error
Runtime error
Commit
·
b3dae47
1
Parent(s):
f439b59
update source display
Browse files
app.py
CHANGED
|
@@ -59,12 +59,13 @@ vectordb_p = Pinecone.from_existing_index(index_name, embeddings)
|
|
| 59 |
# print(type(rr))
|
| 60 |
# print(rr)
|
| 61 |
def chathmi(message, history):
|
| 62 |
-
response = "I don't know"
|
| 63 |
-
print(message)
|
| 64 |
-
response = QAQuery_p(message)
|
| 65 |
time.sleep(0.3)
|
| 66 |
print(history)
|
| 67 |
yield response
|
|
|
|
| 68 |
# yield history
|
| 69 |
|
| 70 |
def chathmi2(message, history):
|
|
@@ -77,7 +78,7 @@ def chathmi2(message, history):
|
|
| 77 |
# chatbot = gr.Chatbot(color_map =("blue", "pink"))
|
| 78 |
|
| 79 |
demo = gr.ChatInterface(
|
| 80 |
-
|
| 81 |
title="STLA BABY - YOUR FRIENDLY GUIDE",
|
| 82 |
)
|
| 83 |
|
|
@@ -121,7 +122,8 @@ def QAQuery_p(question: str):
|
|
| 121 |
print("Source:", res['source_documents'])
|
| 122 |
response = res['result']
|
| 123 |
# response = res['source_documents']
|
| 124 |
-
|
|
|
|
| 125 |
|
| 126 |
def CreatDb():
|
| 127 |
global vectordb
|
|
|
|
| 59 |
# print(type(rr))
|
| 60 |
# print(rr)
|
| 61 |
def chathmi(message, history):
|
| 62 |
+
# response = "I don't know"
|
| 63 |
+
# print(message)
|
| 64 |
+
response, source = QAQuery_p(message)
|
| 65 |
time.sleep(0.3)
|
| 66 |
print(history)
|
| 67 |
yield response
|
| 68 |
+
yield source
|
| 69 |
# yield history
|
| 70 |
|
| 71 |
def chathmi2(message, history):
|
|
|
|
| 78 |
# chatbot = gr.Chatbot(color_map =("blue", "pink"))
|
| 79 |
|
| 80 |
demo = gr.ChatInterface(
|
| 81 |
+
chathmi,
|
| 82 |
title="STLA BABY - YOUR FRIENDLY GUIDE",
|
| 83 |
)
|
| 84 |
|
|
|
|
| 122 |
print("Source:", res['source_documents'])
|
| 123 |
response = res['result']
|
| 124 |
# response = res['source_documents']
|
| 125 |
+
source = res['source_documents']
|
| 126 |
+
return response, source
|
| 127 |
|
| 128 |
def CreatDb():
|
| 129 |
global vectordb
|