Spaces:
Running
Running
Commit
·
7e93398
1
Parent(s):
0666275
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,13 +28,16 @@ def extract_abstract(pdf_bytes):
|
|
| 28 |
return "Error in abstract extraction"
|
| 29 |
|
| 30 |
def process_text(uploaded_file):
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
try:
|
| 40 |
abstract_text = extract_abstract(pdf_bytes)
|
|
|
|
| 28 |
return "Error in abstract extraction"
|
| 29 |
|
| 30 |
def process_text(uploaded_file):
|
| 31 |
+
# Debugging: Print the type and contents of the uploaded_file
|
| 32 |
+
print(f"Uploaded file type: {type(uploaded_file)}")
|
| 33 |
+
print(f"Uploaded file content: {uploaded_file}")
|
| 34 |
+
|
| 35 |
+
# Check if uploaded_file is a dictionary with 'data' key
|
| 36 |
+
if isinstance(uploaded_file, dict) and 'data' in uploaded_file:
|
| 37 |
+
pdf_bytes = uploaded_file['data']
|
| 38 |
+
else:
|
| 39 |
+
print("Uploaded file is not in the expected format")
|
| 40 |
+
return "File content could not be retrieved", None
|
| 41 |
|
| 42 |
try:
|
| 43 |
abstract_text = extract_abstract(pdf_bytes)
|