Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 9, 2024
1 parent 04d3abd commit e401d91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/core/rag/extractor/word_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, file_path: str, tenant_id: str, user_id: str):

self.web_path = self.file_path
# TODO: use a better way to handle the file
self.temp_file = tempfile.NamedTemporaryFile()
self.temp_file = tempfile.NamedTemporaryFile() # noqa: SIM115
self.temp_file.write(r.content)
self.file_path = self.temp_file.name
elif not os.path.isfile(self.file_path):
Expand Down Expand Up @@ -228,7 +228,7 @@ def parse_docx(self, docx_path, image_folder):
if x.tag.endswith("instrText"):
for i in url_pattern.findall(x.text):
hyperlinks_url = str(i)
except Exception as e:
except Exception:
logger.exception("Failed to parse HYPERLINK xml")

def parse_paragraph(paragraph):
Expand Down

0 comments on commit e401d91

Please sign in to comment.