amendolajine commited on
Commit
badf9d9
·
1 Parent(s): 5357f77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -25,7 +25,12 @@ def extract_abstract(pdf_bytes):
25
  # Function to process text (summarize and convert to speech)
26
  def process_text(uploaded_file):
27
  # Extract the file data (byte content) from the uploaded file
28
- pdf_bytes = uploaded_file ["data"]
 
 
 
 
 
29
  abstract_text = extract_abstract(pdf_bytes)
30
 
31
  # Generate summary
 
25
  # Function to process text (summarize and convert to speech)
26
  def process_text(uploaded_file):
27
  # Extract the file data (byte content) from the uploaded file
28
+ # Check if 'content' key exists, and use it to access the file's byte content
29
+ if "content" in uploaded_file:
30
+ pdf_bytes = uploaded_file["content"]
31
+ else:
32
+ return "File content could not be retrieved", None
33
+
34
  abstract_text = extract_abstract(pdf_bytes)
35
 
36
  # Generate summary