AzizWazir commited on
Commit
df265be
·
verified ·
1 Parent(s): 9e24d23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -15,7 +15,8 @@ API_URL = "https://api.groq.com/openai/v1/chat/completions" # Default endpoint
15
 
16
  # PDF Processing Function
17
  def extract_text_from_pdf(pdf_file):
18
- doc = fitz.open(pdf_file)
 
19
  text = ""
20
  for page in doc:
21
  text += page.get_text()
 
15
 
16
  # PDF Processing Function
17
  def extract_text_from_pdf(pdf_file):
18
+ # Read the file from the uploaded BytesIO object
19
+ doc = fitz.open(stream=pdf_file.read(), filetype="pdf")
20
  text = ""
21
  for page in doc:
22
  text += page.get_text()