Commit 1d1c56b5 authored by John Wang's avatar John Wang

fix: pdf loader

parent 049ea8e7
......@@ -38,7 +38,8 @@ class PdfLoader(BaseLoader):
try:
text = storage.load(plaintext_file_key).decode('utf-8')
plaintext_file_exists = True
return text
metadata = {"source": self._file_path}
return [Document(page_content=text, metadata=metadata)]
except FileNotFoundError:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment