Spaces:
Sleeping
Sleeping
Commit
·
c43e786
1
Parent(s):
a5f6b8b
updated app.py
Browse files- .gitignore +2 -1
- app.py +2 -7
.gitignore
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
env
|
|
|
|
1 |
+
env
|
2 |
+
.env
|
app.py
CHANGED
@@ -20,7 +20,7 @@ from langchain_core.prompts import ChatPromptTemplate
|
|
20 |
from langchain.schema.runnable.passthrough import RunnableAssign
|
21 |
from langchain_huggingface import HuggingFaceEmbeddings
|
22 |
from langchain.vectorstores import FAISS
|
23 |
-
from
|
24 |
from langchain_openai import ChatOpenAI
|
25 |
from langchain.output_parsers import PydanticOutputParser
|
26 |
|
@@ -483,12 +483,7 @@ def chat_interface(message, history):
|
|
483 |
|
484 |
# After streaming completes, update KB in background thread
|
485 |
if full_response:
|
486 |
-
|
487 |
-
target=update_knowledge_base,
|
488 |
-
args=(message, full_response),
|
489 |
-
daemon=True
|
490 |
-
)
|
491 |
-
update_thread.start()
|
492 |
|
493 |
with gr.Blocks(css="""
|
494 |
html, body, .gradio-container {
|
|
|
20 |
from langchain.schema.runnable.passthrough import RunnableAssign
|
21 |
from langchain_huggingface import HuggingFaceEmbeddings
|
22 |
from langchain.vectorstores import FAISS
|
23 |
+
from langchain_community.retrievers import BM25Retriever
|
24 |
from langchain_openai import ChatOpenAI
|
25 |
from langchain.output_parsers import PydanticOutputParser
|
26 |
|
|
|
483 |
|
484 |
# After streaming completes, update KB in background thread
|
485 |
if full_response:
|
486 |
+
update_knowledge_base(message, full_response)
|
|
|
|
|
|
|
|
|
|
|
487 |
|
488 |
with gr.Blocks(css="""
|
489 |
html, body, .gradio-container {
|