Spaces:
Build error
Build error
Download testdocling.py from cryogenic22/Synaptyx_docs: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/cryogenic22/Synaptyx_docs/resolve/main/testdocling.py
- Command line
-
hf download hf://spaces/cryogenic22/Synaptyx_docs/testdocling.py
-
curl -L -o testdocling.py https://huggingface.co/spaces/cryogenic22/Synaptyx_docs/resolve/main/testdocling.py
1.08 kB
| 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_setup(): | |
| try: | |
| # Basic setup test | |
| pipeline_options = PdfPipelineOptions() | |
| pipeline_options.do_ocr = False # Start simple without OCR | |
| pipeline_options.do_table_structure = True | |
| converter = DocumentConverter( | |
| format_options={ | |
| InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options) | |
| } | |
| ) | |
| print("✓ Basic setup successful") | |
| return True | |
| except ImportError as e: | |
| print(f"✗ Import Error: {str(e)}") | |
| print("Try: pip install docling") | |
| return False | |
| except Exception as e: | |
| print(f"✗ Other Error: {str(e)}") | |
| return False | |
| if __name__ == "__main__": | |
| logging.basicConfig(level=logging.INFO) | |
| test_docling_setup() |