Spaces:
Build error
Build error
Update variables.py
Browse files- variables.py +2 -0
variables.py
CHANGED
@@ -6,6 +6,7 @@ import pathlib
|
|
6 |
|
7 |
from langchain.embeddings import HuggingFaceEmbeddings,HuggingFaceInstructEmbeddings
|
8 |
from langchain.vectorstores import FAISS
|
|
|
9 |
from langchain.chat_models.openai import ChatOpenAI
|
10 |
from langchain.callbacks.base import CallbackManager
|
11 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
@@ -97,6 +98,7 @@ def embed_tweets(query,_prompt,_docsearch):
|
|
97 |
chain_type_kwargs = {"prompt": _prompt}
|
98 |
chain = VectorDBQA.from_chain_type(
|
99 |
ChatOpenAI(temperature=0),
|
|
|
100 |
chain_type="stuff",
|
101 |
vectorstore=_docsearch,
|
102 |
chain_type_kwargs=chain_type_kwargs,
|
|
|
6 |
|
7 |
from langchain.embeddings import HuggingFaceEmbeddings,HuggingFaceInstructEmbeddings
|
8 |
from langchain.vectorstores import FAISS
|
9 |
+
from langchain.memory import ConversationBufferMemory
|
10 |
from langchain.chat_models.openai import ChatOpenAI
|
11 |
from langchain.callbacks.base import CallbackManager
|
12 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
|
|
98 |
chain_type_kwargs = {"prompt": _prompt}
|
99 |
chain = VectorDBQA.from_chain_type(
|
100 |
ChatOpenAI(temperature=0),
|
101 |
+
memory = ConversationBufferMemory(memory_key="chat_history", input_key="question"),
|
102 |
chain_type="stuff",
|
103 |
vectorstore=_docsearch,
|
104 |
chain_type_kwargs=chain_type_kwargs,
|