From 45f0db3ceed083562ee72302e3fa735feb34b04d Mon Sep 17 00:00:00 2001 From: "Huu Le (Lee)" <39040748+leehuwuj@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:15:00 +0700 Subject: [PATCH] update to check hidden file only for relative path (#11496) --- llama-index-core/llama_index/core/readers/file/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llama-index-core/llama_index/core/readers/file/base.py b/llama-index-core/llama_index/core/readers/file/base.py index efd9ff34b49b8..a20e7d2b7e5db 100644 --- a/llama-index-core/llama_index/core/readers/file/base.py +++ b/llama-index-core/llama_index/core/readers/file/base.py @@ -249,7 +249,9 @@ def _add_files(self, input_dir: Path) -> List[Path]: # in glob for backwards compatibility. ref = Path(ref) is_dir = self.fs.isdir(ref) - skip_because_hidden = self.exclude_hidden and self.is_hidden(ref) + skip_because_hidden = self.exclude_hidden and self.is_hidden( + ref.relative_to(input_dir.absolute()) + ) skip_because_bad_ext = ( self.required_exts is not None and ref.suffix not in self.required_exts )