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
|
|
@ -124,9 +124,8 @@ dependencies = [
|
|||
"cleanlab-tlm>=1.1.2",
|
||||
'gassist>=0.0.1; sys_platform == "win32"',
|
||||
"twelvelabs>=0.4.7",
|
||||
"docling_core>=2.36.1",
|
||||
"filelock>=3.18.0",
|
||||
"docling>=2.36.1",
|
||||
"filelock>=3.18.0"
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
|
|
@ -193,6 +192,10 @@ Repository = "https://github.com/langflow-ai/langflow"
|
|||
Documentation = "https://docs.langflow.org"
|
||||
|
||||
[project.optional-dependencies]
|
||||
docling = [
|
||||
"docling>=2.36.1",
|
||||
]
|
||||
|
||||
audio = [
|
||||
"webrtcvad>=2.0.10",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
32
uv.lock
generated
32
uv.lock
generated
|
|
@ -2741,10 +2741,10 @@ name = "gassist"
|
|||
version = "0.0.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama" },
|
||||
{ name = "flask" },
|
||||
{ name = "flask-cors" },
|
||||
{ name = "tqdm" },
|
||||
{ name = "colorama", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
{ name = "flask", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
{ name = "flask-cors", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
{ name = "tqdm", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b0/2e/f79632d7300874f7f0e60b61a6ab22455a245e1556116a1729542a77b0da/gassist-0.0.1-py3-none-any.whl", hash = "sha256:bb0fac74b453153a6c74b2db40a14fdde7879cbc10ec692ed170e576c8e2b6aa", size = 23819, upload-time = "2025-05-09T18:22:23.609Z" },
|
||||
|
|
@ -4837,7 +4837,7 @@ dependencies = [
|
|||
{ name = "composio-langchain" },
|
||||
{ name = "crewai" },
|
||||
{ name = "datasets" },
|
||||
{ name = "docling" },
|
||||
{ name = "docling-core" },
|
||||
{ name = "dspy-ai" },
|
||||
{ name = "duckduckgo-search" },
|
||||
{ name = "elasticsearch" },
|
||||
|
|
@ -4945,6 +4945,9 @@ clickhouse-connect = [
|
|||
couchbase = [
|
||||
{ name = "couchbase" },
|
||||
]
|
||||
docling = [
|
||||
{ name = "docling" },
|
||||
]
|
||||
local = [
|
||||
{ name = "ctransformers" },
|
||||
{ name = "llama-cpp-python" },
|
||||
|
|
@ -5030,7 +5033,8 @@ requires-dist = [
|
|||
{ name = "crewai", specifier = "==0.102.0" },
|
||||
{ name = "ctransformers", marker = "extra == 'local'", specifier = ">=0.2.10" },
|
||||
{ name = "datasets", specifier = ">2.14.7" },
|
||||
{ name = "docling", specifier = ">=2.36.1" },
|
||||
{ name = "docling", marker = "extra == 'docling'", specifier = ">=2.36.1" },
|
||||
{ name = "docling-core", specifier = ">=2.36.1" },
|
||||
{ name = "dspy-ai", specifier = "==2.5.41" },
|
||||
{ name = "duckduckgo-search", specifier = "==7.2.1" },
|
||||
{ name = "elasticsearch", specifier = "==8.16.0" },
|
||||
|
|
@ -5130,7 +5134,7 @@ requires-dist = [
|
|||
{ name = "youtube-transcript-api", specifier = "==0.6.3" },
|
||||
{ name = "zep-python", specifier = "==2.0.2" },
|
||||
]
|
||||
provides-extras = ["audio", "couchbase", "cassio", "local", "clickhouse-connect", "nv-ingest", "postgresql"]
|
||||
provides-extras = ["docling", "audio", "couchbase", "cassio", "local", "clickhouse-connect", "nv-ingest", "postgresql"]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
|
|
@ -6845,7 +6849,7 @@ name = "nvidia-cudnn-cu12"
|
|||
version = "9.5.1.17"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "nvidia-cublas-cu12" },
|
||||
{ name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/78/4535c9c7f859a64781e43c969a3a7e84c54634e319a996d43ef32ce46f83/nvidia_cudnn_cu12-9.5.1.17-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:30ac3869f6db17d170e0e556dd6cc5eee02647abc31ca856634d5a40f82c15b2", size = 570988386, upload-time = "2024-10-25T19:54:26.39Z" },
|
||||
|
|
@ -6856,7 +6860,7 @@ name = "nvidia-cufft-cu12"
|
|||
version = "11.3.0.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "nvidia-nvjitlink-cu12" },
|
||||
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/8f/16/73727675941ab8e6ffd86ca3a4b7b47065edcca7a997920b831f8147c99d/nvidia_cufft_cu12-11.3.0.4-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ccba62eb9cef5559abd5e0d54ceed2d9934030f51163df018532142a8ec533e5", size = 200221632, upload-time = "2024-11-20T17:41:32.357Z" },
|
||||
|
|
@ -6885,9 +6889,9 @@ name = "nvidia-cusolver-cu12"
|
|||
version = "11.7.1.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "nvidia-cublas-cu12" },
|
||||
{ name = "nvidia-cusparse-cu12" },
|
||||
{ name = "nvidia-nvjitlink-cu12" },
|
||||
{ name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
{ name = "nvidia-cusparse-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/6e/c2cf12c9ff8b872e92b4a5740701e51ff17689c4d726fca91875b07f655d/nvidia_cusolver_cu12-11.7.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e9e49843a7707e42022babb9bcfa33c29857a93b88020c4e4434656a655b698c", size = 158229790, upload-time = "2024-11-20T17:43:43.211Z" },
|
||||
|
|
@ -6899,7 +6903,7 @@ name = "nvidia-cusparse-cu12"
|
|||
version = "12.5.4.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "nvidia-nvjitlink-cu12" },
|
||||
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/06/1e/b8b7c2f4099a37b96af5c9bb158632ea9e5d9d27d7391d7eb8fc45236674/nvidia_cusparse_cu12-12.5.4.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7556d9eca156e18184b94947ade0fba5bb47d69cec46bf8660fd2c71a4b48b73", size = 216561367, upload-time = "2024-11-20T17:44:54.824Z" },
|
||||
|
|
@ -10910,7 +10914,7 @@ name = "triton"
|
|||
version = "3.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "setuptools" },
|
||||
{ name = "setuptools", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||
]
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/a9/549e51e9b1b2c9b854fd761a1d23df0ba2fbc60bd0c13b489ffa518cfcb7/triton-3.3.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b74db445b1c562844d3cfad6e9679c72e93fdfb1a90a24052b03bb5c49d1242e", size = 155600257, upload-time = "2025-05-29T23:39:36.085Z" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue