Update app.py
Browse files
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 |
-
|
|
|
|
| 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()
|