Spaces:
Runtime error
Runtime error
Update rag.py
Browse files- app/rag.py +2 -2
app/rag.py
CHANGED
@@ -16,7 +16,7 @@ class ChatPDF:
|
|
16 |
|
17 |
def __init__(self):
|
18 |
self.model = ChatOllama(model="phi3:mini")
|
19 |
-
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=
|
20 |
# self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1024, chunk_overlap=100)
|
21 |
self.prompt = PromptTemplate.from_template(
|
22 |
"""
|
@@ -38,7 +38,7 @@ class ChatPDF:
|
|
38 |
self.retriever = vector_store.as_retriever(
|
39 |
search_type="similarity_score_threshold",
|
40 |
search_kwargs={
|
41 |
-
"k":
|
42 |
"score_threshold": 0.5,
|
43 |
},
|
44 |
)
|
|
|
16 |
|
17 |
def __init__(self):
|
18 |
self.model = ChatOllama(model="phi3:mini")
|
19 |
+
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1536, chunk_overlap=152)
|
20 |
# self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1024, chunk_overlap=100)
|
21 |
self.prompt = PromptTemplate.from_template(
|
22 |
"""
|
|
|
38 |
self.retriever = vector_store.as_retriever(
|
39 |
search_type="similarity_score_threshold",
|
40 |
search_kwargs={
|
41 |
+
"k": 2,
|
42 |
"score_threshold": 0.5,
|
43 |
},
|
44 |
)
|