Skip to content

Commit

Permalink
fix: fix the incorrect plaintext file key when saving (#10429)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 authored Jan 8, 2025
1 parent d258627 commit 53bb37b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/core/rag/extractor/pdf_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(self, file_path: str, file_cache_key: Optional[str] = None):
self._file_cache_key = file_cache_key

def extract(self) -> list[Document]:
plaintext_file_key = ""
plaintext_file_exists = False
if self._file_cache_key:
try:
Expand All @@ -39,8 +38,8 @@ def extract(self) -> list[Document]:
text = "\n\n".join(text_list)

# save plaintext file for caching
if not plaintext_file_exists and plaintext_file_key:
storage.save(plaintext_file_key, text.encode("utf-8"))
if not plaintext_file_exists and self._file_cache_key:
storage.save(self._file_cache_key, text.encode("utf-8"))

return documents

Expand Down

0 comments on commit 53bb37b

Please sign in to comment.