forked from immich-app/ml-models
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
119 lines (105 loc) · 3.66 KB
/
Copy pathpyproject.toml
File metadata and controls
119 lines (105 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
[project]
name = "immich_model"
version = "0.2.0"
description = "Export Immich's CLIP and face models to ONNX and compile them for on-device runtimes."
readme = "README.md"
# <3.13 held back by the rknn extra's toolkit wheels; the torch-free core (immich_model.runtime
# and the per-EP lowerings it plans) is what immich_ml consumes and must cover its 3.13 runtime.
requires-python = ">=3.10,<3.14"
# The torch-free core: `immich_model.runtime` plus the onnx lowerings.
# The exporter CLI and the model sources live behind the extras below.
# Note: onnxscript and onnx-ir moved to extras due to ml-dtypes conflict with memryx
dependencies = [
"numpy>=1.26",
"onnx>=1.16.1",
"onnxruntime>=1.18.1", # Relaxed to be compatible with memryx (<1.19.dev0)
]
[project.optional-dependencies]
export = [
"huggingface-hub>=0.29.3",
"typer>=0.15.2",
"tenacity>=9.0.0",
"kaggle>=1.7.4.2",
"ml-dtypes>=0.5.0",
"onnx-ir>=0.2.1", # Moved from base deps due to memryx conflict
"onnxscript>=0.7.0", # Moved from base deps due to memryx conflict
"open-clip-torch>=2.31.0",
"multilingual-clip>=1.0.10",
"safetensors>=0.7,<0.8", # drop ceiling once a release carries onnx/ir-py#439, which works with 0.8's TensorSpec API
"transformers>=4.49.0",
"clip-benchmark",
"numpy>=2.1.0",
"torch",
"torchvision",
]
rknn = [
"onnx-ir>=0.2.1", # Moved from base deps due to memryx conflict
"onnxscript>=0.7.0", # Moved from base deps due to memryx conflict
"rknn-toolkit2>=2.3.0",
"pyyaml>=6",
"safetensors>=0.7,<0.8",
"setuptools<81",
"torch",
"typer>=0.15.2",
]
memryx = [
"memryx",
"typer>=0.15.2",
]
[project.scripts]
immich-model = "immich_model.cli:app"
[dependency-groups]
dev = ["black>=23.3.0", "mypy>=1.3.0", "ruff>=0.0.272"]
[tool.uv]
# this repo's own dev/export/rknn environments stay on <=3.12 (the rknn toolkit pins
# numpy<=1.26.4, unresolvable against the 3.13 onnx stack); the widened requires-python
# above is for consumers of the torch-free core (immich_ml runs it on 3.13)
environments = ["python_full_version < '3.13'"]
# `export` and `rknn` have mutually incompatible pins (numpy/protobuf/onnx/torch)
# `export` and `memryx` have incompatible numpy versions (2.1+ vs 1.26.x)
# `rknn` and `memryx` have incompatible onnxruntime versions
conflicts = [
[{ extra = "export" }, { extra = "rknn" }],
[{ extra = "export" }, { extra = "memryx" }],
[{ extra = "rknn" }, { extra = "memryx" }],
]
# onnx: rknn-toolkit2 wheels pin onnx==1.16.1, but the core's onnxscript (which
# prepare_for_rknn itself imports) needs onnx>=1.17 — the toolkit ingests the
# prepared opset-19 graphs fine with newer onnx.
override-dependencies = ["onnxoptimizer>=0.4.2", "onnx>=1.17"]
[tool.uv.sources]
clip-benchmark = { git = "https://github.com/mertalev/CLIP_benchmark.git", rev = "77e733ee241399611296d3c4aca583ec89cf5190" }
torch = { index = "pytorch-cpu" }
torchvision = { index = "pytorch-cpu" }
memryx = { index = "memryx" }
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "memryx"
url = "https://developer.memryx.com/pip"
explicit = true
[tool.hatch.build.targets.sdist]
include = ["immich_model", "models.yaml"]
[tool.hatch.build.targets.wheel]
include = ["immich_model", "models.yaml"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.mypy]
python_version = "3.12"
follow_imports = "silent"
warn_redundant_casts = true
disallow_any_generics = true
check_untyped_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
[tool.ruff]
line-length = 120
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I"]
[tool.black]
line-length = 120
target-version = ['py312']