mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +00:00
fixed the circular dependenciea
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
This commit is contained in:
parent
70872e6539
commit
b2336830eb
@ -12,7 +12,7 @@ from docling.datamodel.pipeline_options_asr_model import (
|
|||||||
InferenceAsrFramework,
|
InferenceAsrFramework,
|
||||||
InlineAsrNativeWhisperOptions,
|
InlineAsrNativeWhisperOptions,
|
||||||
InlineAsrOptions,
|
InlineAsrOptions,
|
||||||
TransformersModelType,
|
# TransformersModelType,
|
||||||
)
|
)
|
||||||
|
|
||||||
_log = logging.getLogger(__name__)
|
_log = logging.getLogger(__name__)
|
||||||
|
@ -26,8 +26,6 @@ class LayoutModelConfig(BaseModel):
|
|||||||
return self.repo_id.replace("/", "--")
|
return self.repo_id.replace("/", "--")
|
||||||
|
|
||||||
|
|
||||||
# HuggingFace Layout Models
|
|
||||||
|
|
||||||
# Default Docling Layout Model
|
# Default Docling Layout Model
|
||||||
DOCLING_LAYOUT_V2 = LayoutModelConfig(
|
DOCLING_LAYOUT_V2 = LayoutModelConfig(
|
||||||
name="docling_layout_v2",
|
name="docling_layout_v2",
|
||||||
|
@ -278,6 +278,7 @@ class VlmPipelineOptions(PaginatedPipelineOptions):
|
|||||||
# If True, text from backend will be used instead of generated text
|
# If True, text from backend will be used instead of generated text
|
||||||
vlm_options: Union[InlineVlmOptions, ApiVlmOptions] = (
|
vlm_options: Union[InlineVlmOptions, ApiVlmOptions] = (
|
||||||
smoldocling_vlm_conversion_options
|
smoldocling_vlm_conversion_options
|
||||||
|
#SMOLDOCLING_TRANSFORMERS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -293,6 +294,9 @@ class AsrPipelineOptions(PipelineOptions):
|
|||||||
artifacts_path: Optional[Union[Path, str]] = None
|
artifacts_path: Optional[Union[Path, str]] = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PdfPipelineOptions(PaginatedPipelineOptions):
|
class PdfPipelineOptions(PaginatedPipelineOptions):
|
||||||
"""Options for the PDF pipeline."""
|
"""Options for the PDF pipeline."""
|
||||||
|
|
||||||
|
@ -5,10 +5,11 @@ from pydantic import AnyUrl, BaseModel
|
|||||||
from typing_extensions import deprecated
|
from typing_extensions import deprecated
|
||||||
|
|
||||||
from docling.datamodel.accelerator_options import AcceleratorDevice
|
from docling.datamodel.accelerator_options import AcceleratorDevice
|
||||||
from docling.datamodel.pipeline_options_vlm_model import (
|
|
||||||
|
# from docling.datamodel.pipeline_options_vlm_model import (
|
||||||
# InferenceFramework,
|
# InferenceFramework,
|
||||||
TransformersModelType,
|
# TransformersModelType,
|
||||||
)
|
# )
|
||||||
|
|
||||||
|
|
||||||
class BaseAsrOptions(BaseModel):
|
class BaseAsrOptions(BaseModel):
|
||||||
|
@ -6,7 +6,6 @@ from pydantic import AnyUrl, BaseModel
|
|||||||
from typing_extensions import deprecated
|
from typing_extensions import deprecated
|
||||||
|
|
||||||
from docling.datamodel.accelerator_options import AcceleratorDevice
|
from docling.datamodel.accelerator_options import AcceleratorDevice
|
||||||
from docling.datamodel.pipeline_options import LayoutOptions
|
|
||||||
|
|
||||||
|
|
||||||
class BaseVlmOptions(BaseModel):
|
class BaseVlmOptions(BaseModel):
|
||||||
@ -89,9 +88,12 @@ class ApiVlmOptions(BaseVlmOptions):
|
|||||||
concurrency: int = 1
|
concurrency: int = 1
|
||||||
response_format: ResponseFormat
|
response_format: ResponseFormat
|
||||||
|
|
||||||
|
from docling.datamodel.layout_model_specs import (
|
||||||
|
LayoutModelConfig,
|
||||||
|
)
|
||||||
|
|
||||||
class TwoStageVlmOptions(BaseModel):
|
class TwoStageVlmOptions(BaseModel):
|
||||||
kind: Literal["inline_two_stage_model_options"] = "inline_two_stage_model_options"
|
kind: Literal["inline_two_stage_model_options"] = "inline_two_stage_model_options"
|
||||||
|
|
||||||
vlm_options: InlineVlmOptions
|
vlm_options: Union[InlineVlmOptions, ApiVlmOptions] # = SMOLDOCLING_TRANSFORMERS
|
||||||
layout_options: LayoutOptions
|
layout_options: LayoutModelConfig # = DOCLING_LAYOUT_V2
|
||||||
|
Loading…
Reference in New Issue
Block a user