Skip to content

Commit 0b11997

Browse files
committed
Adjust Chunk and Overlap Sizes Per Chunk Type
1 parent 2d1e936 commit 0b11997

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

genAi/rag.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def _store_generation_chunks(self, chunks: list[Document]):
119119
def _split_and_attach_metadata(self,
120120
documents: list[Document],
121121
metadata: dict,
122-
chunk_size: int = 512,
123-
chunk_overlap: int = 200) -> list[Document]:
122+
chunk_size: int = 500,
123+
chunk_overlap: int = 75) -> list[Document]:
124124
"""
125125
Split documents into smaller chunks and attach metadata.
126126
@@ -175,8 +175,8 @@ async def load_document(self, doc_name: str, path: str, user_id: str):
175175
generation_chunks = self._split_and_attach_metadata(
176176
[combined_doc],
177177
doc_metadata,
178-
chunk_size=4096,
179-
chunk_overlap=200
178+
chunk_size=4000,
179+
chunk_overlap=0 # no embedding, so no overlap needed
180180
)
181181
# Store generation chunks
182182
self._store_generation_chunks(generation_chunks)

0 commit comments

Comments
 (0)