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="qwen:1.8b")
|
19 |
-
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=
|
20 |
self.prompt = PromptTemplate.from_template(
|
21 |
"""
|
22 |
You are an assistant for question-answering tasks. Use the following pieces of retrieved context to
|
@@ -37,7 +37,7 @@ class ChatPDF:
|
|
37 |
self.retriever = vector_store.as_retriever(
|
38 |
search_type="similarity_score_threshold",
|
39 |
search_kwargs={
|
40 |
-
"k":
|
41 |
"score_threshold": 0.5,
|
42 |
},
|
43 |
)
|
|
|
16 |
|
17 |
def __init__(self):
|
18 |
self.model = ChatOllama(model="qwen:1.8b")
|
19 |
+
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=128, chunk_overlap=16)
|
20 |
self.prompt = PromptTemplate.from_template(
|
21 |
"""
|
22 |
You are an assistant for question-answering tasks. Use the following pieces of retrieved context to
|
|
|
37 |
self.retriever = vector_store.as_retriever(
|
38 |
search_type="similarity_score_threshold",
|
39 |
search_kwargs={
|
40 |
+
"k": 240,
|
41 |
"score_threshold": 0.5,
|
42 |
},
|
43 |
)
|