Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ from langchain.embeddings import HuggingFaceEmbeddings
|
|
| 7 |
from langchain.vectorstores import FAISS
|
| 8 |
from langchain.chains import ConversationalRetrievalChain
|
| 9 |
from langchain.memory import ConversationBufferMemory
|
|
|
|
| 10 |
|
| 11 |
# Simple memory cache
|
| 12 |
class MemoryCache:
|
|
@@ -75,7 +76,7 @@ class GenAIQASystem:
|
|
| 75 |
texts = text_splitter.split_text(self.content)
|
| 76 |
|
| 77 |
# Create vector store
|
| 78 |
-
embeddings =
|
| 79 |
vectorstore = FAISS.from_texts(texts, embeddings)
|
| 80 |
|
| 81 |
# Set up QA chain
|
|
|
|
| 7 |
from langchain.vectorstores import FAISS
|
| 8 |
from langchain.chains import ConversationalRetrievalChain
|
| 9 |
from langchain.memory import ConversationBufferMemory
|
| 10 |
+
from langchain.embeddings import OpenAIEmbeddings
|
| 11 |
|
| 12 |
# Simple memory cache
|
| 13 |
class MemoryCache:
|
|
|
|
| 76 |
texts = text_splitter.split_text(self.content)
|
| 77 |
|
| 78 |
# Create vector store
|
| 79 |
+
embeddings = OpenAIEmbeddings()
|
| 80 |
vectorstore = FAISS.from_texts(texts, embeddings)
|
| 81 |
|
| 82 |
# Set up QA chain
|