Skip to content

Commit

Permalink
MODIFIED: lower the chunk size and chunk overlap in groq_pdf func bec…
Browse files Browse the repository at this point in the history
…ause of rate limit
  • Loading branch information
AquibPy committed May 6, 2024
1 parent 6143a89 commit 44eee4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__pycache__/
venv/
.env
.pytest_cache/
.pytest_cache/
.vscode
2 changes: 1 addition & 1 deletion helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def groq_pdf(pdf,model):
model_name=model
)
text = "".join(page.extract_text() for page in PdfReader(pdf).pages)
text_splitter = RecursiveCharacterTextSplitter(chunk_size=10000, chunk_overlap=1000)
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
chunks = text_splitter.split_text(text)
vectorstore = FAISS.from_texts(chunks, embedding=google_embedding)
retriever = vectorstore.as_retriever()
Expand Down

0 comments on commit 44eee4b

Please sign in to comment.