Fixed to account for docTR refactoring

#2
by mariolr - opened
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -56,7 +56,7 @@ def main():
56
  uploaded_file = st.sidebar.file_uploader("Upload files", type=['pdf', 'png', 'jpeg', 'jpg'])
57
  if uploaded_file is not None:
58
  if uploaded_file.name.endswith('.pdf'):
59
- doc = DocumentFile.from_pdf(uploaded_file.read()).as_images()
60
  else:
61
  doc = DocumentFile.from_images(uploaded_file.read())
62
  page_idx = st.sidebar.selectbox("Page selection", [idx + 1 for idx in range(len(doc))]) - 1
 
56
  uploaded_file = st.sidebar.file_uploader("Upload files", type=['pdf', 'png', 'jpeg', 'jpg'])
57
  if uploaded_file is not None:
58
  if uploaded_file.name.endswith('.pdf'):
59
+ doc = DocumentFile.from_pdf(uploaded_file.read())
60
  else:
61
  doc = DocumentFile.from_images(uploaded_file.read())
62
  page_idx = st.sidebar.selectbox("Page selection", [idx + 1 for idx in range(len(doc))]) - 1