Spaces:
Build error
Build error
Download app.py from cryogenic22/Synaptyx_docs: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/cryogenic22/Synaptyx_docs/resolve/main/app.py
- Command line
-
hf download hf://spaces/cryogenic22/Synaptyx_docs/app.py
-
curl -L -o app.py https://huggingface.co/spaces/cryogenic22/Synaptyx_docs/resolve/main/app.py
1.03 kB
| import streamlit as st | |
| import logging | |
| from pathlib import Path | |
| from docling.document_converter import DocumentConverter | |
| from docling.datamodel.base_models import InputFormat | |
| from docling.datamodel.pipeline_options import PdfPipelineOptions | |
| from docling.document_converter import PdfFormatOption | |
| def test_docling(): | |
| try: | |
| pipeline_options = PdfPipelineOptions() | |
| pipeline_options.do_ocr = False | |
| pipeline_options.do_table_structure = True | |
| converter = DocumentConverter( | |
| format_options={ | |
| InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options) | |
| } | |
| ) | |
| return True, "Docling setup successful" | |
| except Exception as e: | |
| return False, f"Error: {str(e)}" | |
| st.title("Docling Test App") | |
| if st.button("Test Docling Setup"): | |
| with st.spinner("Testing Docling installation..."): | |
| success, message = test_docling() | |
| if success: | |
| st.success(message) | |
| else: | |
| st.error(message) |