Skip to content

The agent engineering platform.

community: fix `DirectoryLoader` progress bar (#19821)

Tomer Cagan463160c3f6fd
diff --git a/libs/community/langchain_community/document_loaders/directory.py b/libs/community/langchain_community/document_loaders/directory.py
index f181ebe95b..b20eff8875 100644
--- a/libs/community/langchain_community/document_loaders/directory.py
+++ b/libs/community/langchain_community/document_loaders/directory.py
@@ -129,6 +129,7 @@ class DirectoryLoader(BaseLoader):
path
for path in paths
if not (self.exclude and any(path.match(glob) for glob in self.exclude))
+ and path.is_file()
]
if self.sample_size > 0: