mitulagr2 commited on
Commit
fbb102b
·
1 Parent(s): c2e715b

Update rag.py

Browse files
Files changed (1) hide show
  1. 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=256, chunk_overlap=5)
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": 12,
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
  )