localGPT
localGPT copied to clipboard
Subfolders in source doc
Add ability to have sub-folders in the SOURCE_DOCUMENT folder so you can copy paste your documents with their organization with out the need to flatten them.
Looks like this has been taken care of in ingest.py:
def load_documents(source_dir: str) -> list[Document]:
# Loads all documents from the source documents directory, including nested folders
paths = []
for root, _, files in os.walk(source_dir):
for file_name in files:
print('Importing: ' + file_name)
file_extension = os.path.splitext(file_name)[1]
source_file_path = os.path.join(root, file_name)
if file_extension in DOCUMENT_MAP.keys():
paths.append(source_file_path)