diff --git a/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py b/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py index 3e8b144c5..d3b81a839 100644 --- a/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py +++ b/packages/jupyter-ai/jupyter_ai/document_loaders/directory.py @@ -4,7 +4,6 @@ import tarfile from datetime import datetime from glob import iglob -from inspect import signature from pathlib import Path from typing import List @@ -137,12 +136,7 @@ def collect_filepaths(path, all_files: bool): filepaths = walk_directory(path, all_files) else: filepaths = [] - glob_iterator = ( - iglob(str(path), recursive=True, include_hidden=all_files) - if "include_hidden" in signature(iglob).parameters - else iglob(str(path), recursive=True) - ) - for glob_path in glob_iterator: + for glob_path in iglob(str(path), recursive=True): if os.path.isfile(glob_path): filepaths.append(Path(glob_path)) valid_exts = {j.lower() for j in SUPPORTED_EXTS}