----------------------
The error message you're seeing indicates that no files were found in the directory
/content/data/paul_graham
. This could be due to a few reasons:
- The directory does not exist. Make sure that the directory
/content/data/paul_graham
exists in your file system.
- The directory exists but is empty. Ensure that there are files within the directory that match the file extensions you're looking to load.
- The directory exists and contains files, but the files do not match the required extensions. If you've specified
required_exts
in SimpleDirectoryReader
, make sure the files in the directory have the correct extensions.
Here's an example of how you can load documents from a directory using
SimpleDirectoryReader
:
from llama_index.core import SimpleDirectoryReader
# Load all (recursive) files from directory
reader = SimpleDirectoryReader(input_dir="/content/data/paul_graham", recursive=True)
documents = reader.load_data()
In this example,
SimpleDirectoryReader
is initialized with the directory path and
recursive=True
to load files from subdirectories as well. Then,
load_data()
is called to load the documents from the specified directory.
If you're still encountering issues, you might want to check the contents of your directory to ensure it contains the expected files. You can do this with a command like
!ls /content/data/paul_graham
in a notebook or
ls /content/data/paul_graham
in a terminal.