Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,8 +23,13 @@ def query_gpt(prompt):
|
|
| 23 |
return response.json()['choices'][0]['message']['content']
|
| 24 |
|
| 25 |
# --------------- PDF TEXT EXTRACTION ---------------
|
| 26 |
-
def extract_text_from_pdf(
|
| 27 |
-
doc = fitz.open(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
text = ""
|
| 29 |
for page in doc:
|
| 30 |
text += page.get_text()
|
|
|
|
| 23 |
return response.json()['choices'][0]['message']['content']
|
| 24 |
|
| 25 |
# --------------- PDF TEXT EXTRACTION ---------------
|
| 26 |
+
def extract_text_from_pdf(pdf_path):
|
| 27 |
+
doc = fitz.open(pdf_path) # open directly using path
|
| 28 |
+
text = ""
|
| 29 |
+
for page in doc:
|
| 30 |
+
text += page.get_text()
|
| 31 |
+
return text
|
| 32 |
+
|
| 33 |
text = ""
|
| 34 |
for page in doc:
|
| 35 |
text += page.get_text()
|