Optimize: Use python-docx for better parsing.
This commit is contained in:
parent
9487eca772
commit
135a40d696
1 changed files with 4 additions and 1 deletions
|
|
@ -499,7 +499,10 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool:
|
|||
content = result.document.export_to_markdown()
|
||||
else:
|
||||
if not pm.is_installed("python-docx"): # type: ignore
|
||||
pm.install("docx")
|
||||
try:
|
||||
pm.install("python-docx")
|
||||
except Exception:
|
||||
pm.install("docx")
|
||||
from docx import Document # type: ignore
|
||||
from io import BytesIO
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue