Skip to content

Commit

Permalink
feat: Update file loading logic in File model (#2857)
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard authored Jul 12, 2024
1 parent 5cc1ae5 commit 77e1cfb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/api/quivr_api/models/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def compute_documents(self, loader_class):
"""
logger.info(f"Computing documents from file {self.file_name}")
loader = loader_class(self.tmp_file_path)
documents = [loader.load()]
documents = []
documents.extend(loader.load())

text_splitter = RecursiveCharacterTextSplitter.from_tiktoken_encoder(
chunk_size=self.chunk_size, chunk_overlap=self.chunk_overlap
Expand Down

1 comment on commit 77e1cfb

@zdkderpphb
Copy link

Choose a reason for hiding this comment

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

I imported the latest commits and this change caused page_content not to be found in the tuple. After I changed it back to documents = [loader.load()] the knowledge filling worked again.

Please sign in to comment.