From 07741e09f4569d27aca3ffa111178bc324af1eab Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 5 Apr 2024 01:57:31 +0200 Subject: Add .env for parser --- rag/parser/pdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rag/parser/pdf.py') diff --git a/rag/parser/pdf.py b/rag/parser/pdf.py index a5e4665..1680a47 100644 --- a/rag/parser/pdf.py +++ b/rag/parser/pdf.py @@ -8,7 +8,8 @@ from langchain_community.document_loaders import PyPDFLoader def parser(filepath: Path): content = PyPDFLoader(filepath).load() splitter = RecursiveCharacterTextSplitter( - chunk_size=os.environ["CHUNK_SIZE"], chunk_overlap=os.environ["CHUNK_OVERLAP"] + chunk_size=int(os.environ["CHUNK_SIZE"]), + chunk_overlap=int(os.environ["CHUNK_OVERLAP"]), ) chunks = splitter.split_documents(content) return chunks -- cgit v1.2.3-70-g09d2