Skip to content

Commit

Permalink
using temp file to load pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
andrptrc committed Jan 8, 2024
1 parent ecda4c3 commit 370d331
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ def process(self, data):
chunk_size=500,
chunk_overlap=100,
)
loader = PyMuPDFLoader(raw)

# raw content as PDF temp file
with open("temp.pdf", "wb") as f:
f.write(raw)
loader = PyMuPDFLoader("temp.pdf")
doc = loader.load_and_split(text_splitter)
vectorstore = FAISS.from_documents(
documents=doc,
Expand Down

0 comments on commit 370d331

Please sign in to comment.