fix: update docling dependency to use docling_core instead (#8714)
* chore: update dependencies in pyproject.toml and uv.lock * Updated `docling` to `docling_core>=2.38.0` in `pyproject.toml`. * Removed outdated `docling` package entries from `uv.lock`. * Adjusted dependency markers for `gassist` and `triton` to improve compatibility across platforms. * chore: downgrade docling_core dependency in pyproject.toml * Changed `docling_core` version from `>=2.38.0` to `>=2.36.1` for compatibility. * Added optional dependency group for `docling` with the updated version. * Added traceloop.py and initialized in service.py, also updated pyproject.toml * updated returned callbacks list length from 5 to 6. Formatted service.py * [autofix.ci] apply automated fixes * OpenInference span kind replaced with Opentelemetry Span kind * Added traceloop.py and initialized in service.py, also updated pyproject.toml * updated returned callbacks list length from 5 to 6. Formatted service.py * [autofix.ci] apply automated fixes * OpenInference span kind replaced with Opentelemetry Span kind * Added traceloop.py and initialized in service.py, also updated pyproject.toml * updated returned callbacks list length from 5 to 6. Formatted service.py * [autofix.ci] apply automated fixes * OpenInference span kind replaced with Opentelemetry Span kind * Updated as per coderabbitai suggested and tested * Fixed deprecated NoneType * code formatted * revert uv.lock * add new line to uv.lock * updated service.py * [autofix.ci] apply automated fixes * fix(DoclingInlineComponent): add import error handling for missing Docling module * Revert "Merge branch '2getsandesh/main' into remove-torch-deps" This reverts commit b95891f0e27e8620873fbe97116709ca5de41e51, reversing changes made to 9e0f1ae30a6655a82948546035147e0e2fc924ae. --------- Co-authored-by: Sandesh R <2getsandesh@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Sandesh R <Sandesh.R24@ibm.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
This commit is contained in:
parent
175fc7e773
commit
e28104c852
3 changed files with 40 additions and 26 deletions
|
|
@ -1,13 +1,3 @@
|
|||
from docling.datamodel.base_models import ConversionStatus, InputFormat
|
||||
from docling.datamodel.pipeline_options import (
|
||||
OcrOptions,
|
||||
PdfPipelineOptions,
|
||||
VlmPipelineOptions,
|
||||
)
|
||||
from docling.document_converter import DocumentConverter, FormatOption, PdfFormatOption
|
||||
from docling.models.factories import get_ocr_factory
|
||||
from docling.pipeline.vlm_pipeline import VlmPipeline
|
||||
|
||||
from langflow.base.data import BaseFileComponent
|
||||
from langflow.inputs import DropdownInput
|
||||
from langflow.schema import Data
|
||||
|
|
@ -80,6 +70,23 @@ class DoclingInlineComponent(BaseFileComponent):
|
|||
]
|
||||
|
||||
def process_files(self, file_list: list[BaseFileComponent.BaseFile]) -> list[BaseFileComponent.BaseFile]:
|
||||
try:
|
||||
from docling.datamodel.base_models import ConversionStatus, InputFormat
|
||||
from docling.datamodel.pipeline_options import (
|
||||
OcrOptions,
|
||||
PdfPipelineOptions,
|
||||
VlmPipelineOptions,
|
||||
)
|
||||
from docling.document_converter import DocumentConverter, FormatOption, PdfFormatOption
|
||||
from docling.models.factories import get_ocr_factory
|
||||
from docling.pipeline.vlm_pipeline import VlmPipeline
|
||||
except ImportError as e:
|
||||
msg = (
|
||||
"Docling is not installed. Please install it with `uv pip install docling` or"
|
||||
" `uv pip install langflow[docling]`."
|
||||
)
|
||||
raise ImportError(msg) from e
|
||||
|
||||
# Configure the standard PDF pipeline
|
||||
def _get_standard_opts() -> PdfPipelineOptions:
|
||||
pipeline_options = PdfPipelineOptions()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue