style:fmt

This commit is contained in:
aries_ckt 2023-07-25 17:22:11 +08:00
parent e7dcbe3dab
commit 795be61d4a
2 changed files with 8 additions and 2 deletions

View File

@ -22,5 +22,7 @@ class DocxLoader(BaseLoader):
para = doc.paragraphs[i]
text = para.text
content.append(text)
docs.append(Document(page_content=''.join(content), metadata={"source": self.file_path}))
docs.append(
Document(page_content="".join(content), metadata={"source": self.file_path})
)
return docs

View File

@ -20,5 +20,9 @@ class PPTLoader(BaseLoader):
for slide in pr.slides:
for shape in slide.shapes:
if hasattr(shape, "text") and shape.text is not "":
docs.append(Document(page_content=shape.text, metadata={"source": slide.slide_id}))
docs.append(
Document(
page_content=shape.text, metadata={"source": slide.slide_id}
)
)
return docs