Skip to content

Commit b200c65

Browse files
committed
Pin exactly torch 2.9.1 for nemotron-ocr extra
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
1 parent 664bd7d commit b200c65

2 files changed

Lines changed: 696 additions & 390 deletions

File tree

pyproject.toml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ dependencies = [
4747
'docling-core[chunking] (>=2.66.0,<3.0.0)',
4848
'docling-parse (>=5.3.2,<6.0.0)',
4949
"docling-ibm-models>=3.12.0,<4",
50-
'torch (>=2.2.2,<3.0.0)',
51-
'torchvision (>=0,<1)',
50+
'torch (>=2.2.2,<3.0.0) ; extra != "nemotron-ocr"',
51+
'torchvision (>=0,<1) ; extra != "nemotron-ocr"',
5252
'filetype (>=1.2.0,<2.0.0)',
5353
'pypdfium2 (>=4.30.0,!=4.30.1,<6.0.0)',
5454
'pydantic-settings (>=2.3.0,<3.0.0)',
@@ -91,7 +91,11 @@ docling-tools = "docling.cli.tools:app"
9191

9292
[project.optional-dependencies]
9393
easyocr = ['easyocr (>=1.7,<2.0)']
94-
nemotron-ocr = ['nemotron-ocr (>=1.0.1,<2.0.0) ; python_version == "3.12" and sys_platform == "linux" and platform_machine == "x86_64"']
94+
nemotron-ocr = [
95+
'nemotron-ocr (>=1.0.1,<2.0.0) ; python_version == "3.12" and sys_platform == "linux" and platform_machine == "x86_64"',
96+
'torch (==2.9.1+cu130) ; python_version == "3.12" and sys_platform == "linux" and platform_machine == "x86_64"',
97+
'torchvision (==0.24.1+cu130) ; python_version == "3.12" and sys_platform == "linux" and platform_machine == "x86_64"',
98+
]
9599
tesserocr = ['tesserocr (>=2.7.1,<3.0.0)']
96100
ocrmac = ['ocrmac (>=1.0.0,<2.0.0) ; sys_platform == "darwin"']
97101
vlm = [
@@ -173,6 +177,19 @@ constraints = [
173177
package = true
174178
default-groups = "all"
175179

180+
[tool.uv.sources]
181+
torch = [
182+
{ index = "pytorch-cu130", extra = "nemotron-ocr", marker = "python_version == '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'" },
183+
]
184+
torchvision = [
185+
{ index = "pytorch-cu130", extra = "nemotron-ocr", marker = "python_version == '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'" },
186+
]
187+
188+
[[tool.uv.index]]
189+
name = "pytorch-cu130"
190+
url = "https://download.pytorch.org/whl/cu130"
191+
explicit = true
192+
176193
[tool.setuptools.packages.find]
177194
include = ["docling*"]
178195

0 commit comments

Comments
 (0)