Spaces:
Running
Running
Commit
·
8fcf400
1
Parent(s):
61533ab
Fixed to account for docTR refactoring (#2)
Browse files- Fixed to account for docTR refactoring (5cb4fc3a9dc00299a08a7fe5ca9291b75e74db7d)
Co-authored-by: Mario <[email protected]>
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())
|
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
|