Spaces:
Running
Running
Commit
·
0666275
1
Parent(s):
3abff09
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,12 +28,13 @@ def extract_abstract(pdf_bytes):
|
|
| 28 |
return "Error in abstract extraction"
|
| 29 |
|
| 30 |
def process_text(uploaded_file):
|
|
|
|
|
|
|
| 31 |
try:
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
return "File content could not be retrieved", None
|
| 37 |
|
| 38 |
try:
|
| 39 |
abstract_text = extract_abstract(pdf_bytes)
|
|
|
|
| 28 |
return "Error in abstract extraction"
|
| 29 |
|
| 30 |
def process_text(uploaded_file):
|
| 31 |
+
# Extract the file data (byte content) from the uploaded file
|
| 32 |
+
pdf_bytes = uploaded_file['data']
|
| 33 |
try:
|
| 34 |
+
abstract_text = extract_abstract(pdf_bytes)
|
| 35 |
+
except Exception as e:
|
| 36 |
+
print(f"Error extracting abstract: {e}")
|
| 37 |
+
return "Error in abstract extraction", None
|
|
|
|
| 38 |
|
| 39 |
try:
|
| 40 |
abstract_text = extract_abstract(pdf_bytes)
|