feat: Update file loading logic in File model (#2857)

This commit is contained in:
Stan Girard 2024-07-12 16:50:27 +02:00 committed by GitHub
parent 5cc1ae5423
commit 77e1cfb77f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,7 +42,8 @@ class File(BaseModel):
"""
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