AIAnytime / Search-Your-PDF-App

Search Your PDF App using Langchain, ChromaDB, Sentence Transformers, and LaMiNi LM Model. This app is completely powered by Open Source Models. No OpenAI key is required.
MIT License
52 stars 40 forks source link

Only last pdf is getting ingested into the database #5

Open Kedar-dave opened 8 months ago

Kedar-dave commented 8 months ago

There is a small inaccuracy in ingest.py where documents are not loaded into the variable and the variable does not include the fact that the documents will be a list type rather than a single document.

documents = [] for root, dirs, files in os.walk("docs"): for file in files: if file.endswith(".pdf"): loader = PyPDFLoader(os.path.join(root, file)) documents.extend(loader.load()) print(file) The above code is a fix for the issue