rbold1234 commited on
Commit
1b56928
·
verified ·
1 Parent(s): cf9646c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -9,7 +9,7 @@ summarizer = pipeline("summarization", model="facebook/bart-base")
9
  def extract_text_from_file(file):
10
  if file.name.endswith(".pdf"):
11
  with pdfplumber.open(file.name) as pdf:
12
- return "\n".join([page.extract_text() for page in pdf if page.extract_text()])
13
  elif file.name.endswith(".docx"):
14
  return docx2txt.process(file.name)
15
  return ""
 
9
  def extract_text_from_file(file):
10
  if file.name.endswith(".pdf"):
11
  with pdfplumber.open(file.name) as pdf:
12
+ return "\n".join([page.extract_text() for page in pdf.pages if page.extract_text()])
13
  elif file.name.endswith(".docx"):
14
  return docx2txt.process(file.name)
15
  return ""