extract-python 0.5.14__tar.gz → 0.5.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {extract_python-0.5.14 → extract_python-0.5.15}/PKG-INFO +1 -1
- {extract_python-0.5.14 → extract_python-0.5.15}/extract_python/docling_.py +12 -3
- {extract_python-0.5.14 → extract_python-0.5.15}/.gitignore +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/.python-version +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/README.md +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/benches/__init__.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/benches/compare.ipynb +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/benches/compare.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/benches/constants.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/data/.gitignore +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/extract_python/__init__.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/extract_python/constants.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/extract_python/marker_.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/extract_python/miner_u.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/extract_python/utils.py +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/pyproject.toml +0 -0
- {extract_python-0.5.14 → extract_python-0.5.15}/uv.lock +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import json
|
|
3
|
+
import logging
|
|
2
4
|
import shutil
|
|
3
5
|
import tempfile
|
|
4
6
|
from collections.abc import AsyncGenerator, Iterable, Iterator
|
|
7
|
+
from functools import partial
|
|
5
8
|
from pathlib import Path
|
|
6
9
|
from typing import Any, Self
|
|
7
10
|
|
|
@@ -36,6 +39,8 @@ from pydantic_core.core_schema import SerializerFunctionWrapHandler
|
|
|
36
39
|
from .constants import ARTIFACTS, DEFAULT_MD_PAGE_SEP
|
|
37
40
|
from .utils import chdir, map_and_preserve, path_to_artifacts_dirname
|
|
38
41
|
|
|
42
|
+
logger = logging.getLogger(__name__)
|
|
43
|
+
|
|
39
44
|
DOCLING_DEFAULT_ARTIFACTS_PATH = Path.home().joinpath(".cache", "docling", "models")
|
|
40
45
|
|
|
41
46
|
|
|
@@ -48,9 +53,13 @@ class DoclingPipeline(Pipeline):
|
|
|
48
53
|
device: Device = Device.CPU,
|
|
49
54
|
):
|
|
50
55
|
super().__init__(device)
|
|
51
|
-
format_options =
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
format_options = dict()
|
|
57
|
+
for k, v in format_options.items():
|
|
58
|
+
format_options[k] = v.to_docling(self._device)
|
|
59
|
+
logger.info(
|
|
60
|
+
"resolved format options to: %s",
|
|
61
|
+
lambda: partial(json.dumps, format_options, indent=2),
|
|
62
|
+
)
|
|
54
63
|
allowed_format = [
|
|
55
64
|
f.to_docling() for f in DoclingPipelineConfig.supported_exts()
|
|
56
65
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|