tregu0458 commited on
Commit
96a0453
·
verified ·
1 Parent(s): a768471

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -23,9 +23,10 @@ def extract_text(url: str, language: str = "ja", length: int = 150000):
23
  pdf_file_path = os.path.join("/app/downloads", os.path.basename(url))
24
  with open(pdf_file_path, "wb") as pdf_file:
25
  pdf_file.write(response.content)
26
- loader = UnstructuredPDFLoader(pdf_file_path)
27
- docs = loader.load()
28
- text_content = docs[0].page_content
 
29
  else:
30
  # それ以外の場合
31
  loader = WebBaseLoader(url)
 
23
  pdf_file_path = os.path.join("/app/downloads", os.path.basename(url))
24
  with open(pdf_file_path, "wb") as pdf_file:
25
  pdf_file.write(response.content)
26
+ # loader = UnstructuredPDFLoader(pdf_file_path)
27
+ # docs = loader.load()
28
+ # text_content = docs[0].page_content
29
+ text_content = pdf_file_path
30
  else:
31
  # それ以外の場合
32
  loader = WebBaseLoader(url)