mirror of
https://github.com/run-llama/llama-hub.git
synced 2025-11-03 19:30:13 +00:00
skip folders in s3
This commit is contained in:
parent
adaa2d78a6
commit
8948cff28d
@ -75,6 +75,8 @@ class S3Reader(BaseReader):
|
||||
else:
|
||||
bucket = s3.Bucket(self.bucket)
|
||||
for obj in bucket.objects.filter(Prefix=self.prefix):
|
||||
if obj.key.endswith("/"): # skip folders
|
||||
continue
|
||||
suffix = Path(obj.key).suffix
|
||||
filepath = (
|
||||
f"{temp_dir}/{next(tempfile._get_candidate_names())}{suffix}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user