Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,8 +60,8 @@ def prepare_vector_store_retriever(filename):
|
|
| 60 |
# Split the text
|
| 61 |
text_splitter = CharacterTextSplitter(
|
| 62 |
separator="\n\n",
|
| 63 |
-
chunk_size=
|
| 64 |
-
chunk_overlap=
|
| 65 |
length_function=len
|
| 66 |
)
|
| 67 |
|
|
@@ -71,7 +71,7 @@ def prepare_vector_store_retriever(filename):
|
|
| 71 |
embeddings = HuggingFaceEmbeddings()
|
| 72 |
vectorstore = FAISS.from_documents(documents, embeddings)
|
| 73 |
|
| 74 |
-
return VectorStoreRetriever(vectorstore=vectorstore)
|
| 75 |
|
| 76 |
# Retrieveal QA chian
|
| 77 |
def get_retrieval_qa_chain(text_file):
|
|
|
|
| 60 |
# Split the text
|
| 61 |
text_splitter = CharacterTextSplitter(
|
| 62 |
separator="\n\n",
|
| 63 |
+
chunk_size=800,
|
| 64 |
+
chunk_overlap=0,
|
| 65 |
length_function=len
|
| 66 |
)
|
| 67 |
|
|
|
|
| 71 |
embeddings = HuggingFaceEmbeddings()
|
| 72 |
vectorstore = FAISS.from_documents(documents, embeddings)
|
| 73 |
|
| 74 |
+
return VectorStoreRetriever(vectorstore=vectorstore, search_kwargs={"k": 2})
|
| 75 |
|
| 76 |
# Retrieveal QA chian
|
| 77 |
def get_retrieval_qa_chain(text_file):
|