solewarrior commited on
Commit
944709e
·
verified ·
1 Parent(s): 654aabc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -61,7 +61,7 @@ def extract_text_from_pdf(uploaded_file):
61
  pdf_reader = PyPDF2.PdfReader(uploaded_file)
62
  text = ""
63
  for page in pdf_reader.pages:
64
- text += page.extract_text() or "" # Ensure we avoid NoneType issues
65
  return text.strip()
66
  except Exception as e:
67
  st.error(f"Error reading the PDF: {e}")
@@ -100,7 +100,7 @@ st.sidebar.title("AI Solutions")
100
  option = st.sidebar.selectbox(
101
  "Choose a task",
102
  ["Text Summarization", "Question Answering", "Text Classification", "Language Translation"],
103
- index=0 # Makes Text Summarization the default
104
  )
105
 
106
  if option == "Text Summarization":
 
61
  pdf_reader = PyPDF2.PdfReader(uploaded_file)
62
  text = ""
63
  for page in pdf_reader.pages:
64
+ text += page.extract_text() or ""
65
  return text.strip()
66
  except Exception as e:
67
  st.error(f"Error reading the PDF: {e}")
 
100
  option = st.sidebar.selectbox(
101
  "Choose a task",
102
  ["Text Summarization", "Question Answering", "Text Classification", "Language Translation"],
103
+ index=0
104
  )
105
 
106
  if option == "Text Summarization":