2

I am using llama_index package to index some of our own documents and query them using GPT. It works fairly well with individual PDFs. However we have a large anout of PDFs which I would like to load in a single run as using its SimpleDirectoryReader. But I am getting the following error when the following commands were run.

from llama_index import download_loader 
SimpleDirectoryReader = download_loader("SimpleDirectoryReader")


FileNotFoundError: [Errno 2] No such file or directory:  C:\\Users\\XXXXX\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\gpt_index\\readers\\llamahub_modules/file/base.py' 

The readers\llamahub_modules\file folder only has a folder called 'pdf'. It doesn't have a base.py file. How

I tried uninstalling and re-installing llama_index python module but there was no impact. My python version is 3.8.2

How can I get it working?

Ishan Hettiarachchi
  • 1,426
  • 2
  • 19
  • 31

2 Answers2

0

In the documentation there are two ways of doing it. following worked which doesn't explicitly load the reader.

documents = SimpleDirectoryReader('./data').load_data()
Ishan Hettiarachchi
  • 1,426
  • 2
  • 19
  • 31
0

No need to reinstall llama_index python module. Try Referring to the folder as below :

bulk_documents = SimpleDirectoryReader('./multipleData').load_data()
  • Also don't forget to keep your files in '.rtf' format.
  • If this is not working then you may refer to the doucmentation of llama_index. Some functions are renamed in the latest versions. So do check out their documenation : Llama_index Documents Loader Documentation