ashhal commited on
Commit
127d5cd
Β·
verified Β·
1 Parent(s): 5aad2ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -9,6 +9,7 @@ explainer = pipeline("text2text-generation", model="google/flan-t5-base")
9
  # Extract text from PDF
10
  def extract_text_from_pdf(pdf_file):
11
  try:
 
12
  with fitz.open(stream=pdf_file.read(), filetype="pdf") as doc:
13
  text = ""
14
  for page in doc:
 
9
  # Extract text from PDF
10
  def extract_text_from_pdf(pdf_file):
11
  try:
12
+ pdf_file.seek(0) # πŸ‘ˆ Add this to rewind the file
13
  with fitz.open(stream=pdf_file.read(), filetype="pdf") as doc:
14
  text = ""
15
  for page in doc: