From 3ea112ad72eb395628b17f256559032b944ea267 Mon Sep 17 00:00:00 2001 From: Jason Weill <93281816+JasonWeill@users.noreply.github.com> Date: Thu, 2 Nov 2023 09:51:37 -0700 Subject: [PATCH] Update packages/jupyter-ai/jupyter_ai/document_loaders/directory.py Co-authored-by: Piyush Jain --- .../jupyter-ai/jupyter_ai/document_loaders/directory.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py b/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py index 25705f464..e62e9a18b 100644 --- a/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py +++ b/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py @@ -56,12 +56,11 @@ def split(path, all: bool, splitter): continue for filename in filenames: - filepath = Path(os.path.join(dir, filename)) - if filepath.suffix not in SUPPORTED_EXTS: + if not all and filename.startswith("."): continue - # Unless we're learning "all" files, exclude hidden files - if all is False and filepath.name[0] == ".": + filepath = Path(os.path.join(dir, filename)) + if filepath.suffix not in SUPPORTED_EXTS: continue document = dask.delayed(path_to_doc)(filepath)