Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
fix key error
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Jan 17, 2024
1 parent 95eeb34 commit d89efe1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llama_hub/s3/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(
prefix: Optional[str] = "",
file_extractor: Optional[Dict[str, Union[str, BaseReader]]] = None,
required_exts: Optional[List[str]] = None,
filename_as_id: bool = False,
filename_as_id: bool = True,
num_files_limit: Optional[int] = None,
file_metadata: Optional[Callable[[str], Dict]] = None,
aws_access_id: Optional[str] = None,
Expand Down Expand Up @@ -152,8 +152,7 @@ def load_data(self, custom_temp_subdir: str = None) -> List[Document]:
documents = self.load_s3_files_as_docs(temp_dir)
shutil.rmtree(temp_dir)

if not self.filename_as_id:
for doc in documents:
doc.id_ = self.s3_endpoint_url + "_" + doc.metadata["filename"]
for doc in documents:
doc.id_ = self.s3_endpoint_url + "_" + doc.id_

return documents

1 comment on commit d89efe1

@arnavroh45
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not fixed.

Please sign in to comment.