mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-01 15:02:21 +00:00
allow the artifacts_path to be defined as ENV
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
de462090e7
commit
686b3a0616
@ -1,6 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Annotated, Tuple
|
from typing import Annotated, Optional, Tuple
|
||||||
|
|
||||||
from pydantic import BaseModel, PlainValidator
|
from pydantic import BaseModel, PlainValidator
|
||||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||||
@ -62,6 +62,7 @@ class AppSettings(BaseSettings):
|
|||||||
debug: DebugSettings
|
debug: DebugSettings
|
||||||
|
|
||||||
cache_dir: Path = Path.home() / ".cache" / "docling"
|
cache_dir: Path = Path.home() / ".cache" / "docling"
|
||||||
|
artifacts_path: Optional[Path] = None
|
||||||
|
|
||||||
|
|
||||||
settings = AppSettings(perf=BatchConcurrencySettings(), debug=DebugSettings())
|
settings = AppSettings(perf=BatchConcurrencySettings(), debug=DebugSettings())
|
||||||
|
@ -61,6 +61,8 @@ class StandardPdfPipeline(PaginatedPipeline):
|
|||||||
artifacts_path: Optional[Path] = None
|
artifacts_path: Optional[Path] = None
|
||||||
if pipeline_options.artifacts_path is not None:
|
if pipeline_options.artifacts_path is not None:
|
||||||
artifacts_path = Path(pipeline_options.artifacts_path).expanduser()
|
artifacts_path = Path(pipeline_options.artifacts_path).expanduser()
|
||||||
|
elif settings.artifacts_path is not None:
|
||||||
|
artifacts_path = Path(settings.artifacts_path).expanduser()
|
||||||
|
|
||||||
self.keep_images = (
|
self.keep_images = (
|
||||||
self.pipeline_options.generate_page_images
|
self.pipeline_options.generate_page_images
|
||||||
|
Loading…
Reference in New Issue
Block a user