Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: bug with loading directories #1073

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions memgpt/autogen/memgpt_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def load(self, name: str, type: str, **kwargs):
load_directory(name=name, **kwargs)
elif type == "webpage":
load_webpage(name=name, **kwargs)
elif type == "index":
load_index(name=name, **kwargs)
elif type == "database":
load_database(name=name, **kwargs)
elif type == "vector_database":
Expand Down
4 changes: 2 additions & 2 deletions memgpt/data_sources/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, input_files: List[str] = None, input_directory: str = None, r
self.extensions = extensions

if self.recursive == True:
assert self.input_dir is not None, "Must provide input directory if recursive is True."
assert self.input_directory is not None, "Must provide input directory if recursive is True."

def generate_documents(self) -> Iterator[Tuple[str, Dict]]: # -> Iterator[Document]:
from llama_index.core import SimpleDirectoryReader
Expand All @@ -101,7 +101,7 @@ def generate_documents(self) -> Iterator[Tuple[str, Dict]]: # -> Iterator[Docum
assert self.input_files is not None, "Must provide input files if input_dir is None"
reader = SimpleDirectoryReader(input_files=[str(f) for f in self.input_files])

llama_index_docs = reader.load_data()
llama_index_docs = reader.load_data(show_progress=True)
docs = []
for llama_index_doc in llama_index_docs:
# TODO: add additional metadata?
Expand Down
Loading