nvti commited on
Commit
aefa805
·
1 Parent(s): 20a27c7

feat(hf): use ZeroGPU for analysis

Browse files
README.md CHANGED
@@ -69,6 +69,22 @@ Backend implementations live in `src/pozify/steps/pose_backends/` and return the
69
  `mmpose` backend class is included as the integration point for OpenMMLab MMPose; implementing it
70
  requires installing MMPose/MMCV and mapping model keypoints into the shared landmark dictionary.
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  When running in real mode, the UI summary now shows:
73
 
74
  - `Analysis mode`: `mock` or `real`
 
69
  `mmpose` backend class is included as the integration point for OpenMMLab MMPose; implementing it
70
  requires installing MMPose/MMCV and mapping model keypoints into the shared landmark dictionary.
71
 
72
+ ## Hugging Face ZeroGPU
73
+
74
+ When this app runs on a Hugging Face Space with ZeroGPU hardware selected, the API analysis path is
75
+ wrapped with `spaces.GPU`. The same code path is effect-free outside ZeroGPU, so local runs and CPU
76
+ Spaces continue to use CPU by default.
77
+
78
+ The runtime uses these defaults:
79
+
80
+ - `SPACES_ZERO_GPU=1`: set by Hugging Face ZeroGPU; enables CUDA for the Torch exercise router.
81
+ - `POZIFY_ROUTER_DEVICE`: optional override for router inference, for example `cpu` or `cuda`.
82
+ - `POZIFY_SPACES_GPU_DURATION`: optional `spaces.GPU` duration in seconds, default `120`.
83
+
84
+ The MediaPipe Tasks backend tries its GPU delegate on ZeroGPU and falls back to CPU if unavailable.
85
+ The older `mp.solutions.pose` path remains CPU-only. The ZeroGPU wrapper is in place for the full
86
+ analysis call and any CUDA-capable router or future pose backend used inside that call.
87
+
88
  When running in real mode, the UI summary now shows:
89
 
90
  - `Analysis mode`: `mock` or `real`
app.py CHANGED
@@ -17,6 +17,7 @@ from fastapi.staticfiles import StaticFiles
17
  sys.path.insert(0, str(Path(__file__).parent / "src"))
18
 
19
  from pozify.exercise_catalog import USER_SELECTABLE_EXERCISES
 
20
  from pozify.pipeline import run_pipeline
21
 
22
  BASE_DIR = Path(__file__).parent
@@ -187,6 +188,23 @@ def _profile_input(
187
  }
188
 
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  async def _save_upload(video: UploadFile | None) -> str | None:
191
  video_path: str | None = None
192
  if video is not None and video.filename:
@@ -254,7 +272,7 @@ async def analyze_api(
254
  )
255
  video_path = await _save_upload(video)
256
  try:
257
- result = run_pipeline(video_path=video_path, profile_input=profile)
258
  finally:
259
  if video_path is not None:
260
  Path(video_path).unlink(missing_ok=True)
@@ -285,11 +303,7 @@ async def analyze_stream_api(
285
 
286
  def worker() -> None:
287
  try:
288
- result = run_pipeline(
289
- video_path=video_path,
290
- profile_input=profile,
291
- progress=events.put,
292
- )
293
  events.put({"type": "complete", "result": _analysis_response(result)})
294
  except Exception as exc: # pragma: no cover - surfaced to browser clients
295
  events.put({"type": "error", "detail": str(exc)})
 
17
  sys.path.insert(0, str(Path(__file__).parent / "src"))
18
 
19
  from pozify.exercise_catalog import USER_SELECTABLE_EXERCISES
20
+ from pozify.hf_spaces import default_spaces_gpu_duration, spaces_gpu
21
  from pozify.pipeline import run_pipeline
22
 
23
  BASE_DIR = Path(__file__).parent
 
188
  }
189
 
190
 
191
+ def _analysis_gpu_duration(*_args: Any, **_kwargs: Any) -> int:
192
+ return default_spaces_gpu_duration()
193
+
194
+
195
+ @spaces_gpu(duration=_analysis_gpu_duration)
196
+ def _run_analysis_pipeline(
197
+ video_path: str | None,
198
+ profile_input: dict[str, Any],
199
+ progress: Any | None = None,
200
+ ) -> dict[str, Any]:
201
+ return run_pipeline(
202
+ video_path=video_path,
203
+ profile_input=profile_input,
204
+ progress=progress,
205
+ )
206
+
207
+
208
  async def _save_upload(video: UploadFile | None) -> str | None:
209
  video_path: str | None = None
210
  if video is not None and video.filename:
 
272
  )
273
  video_path = await _save_upload(video)
274
  try:
275
+ result = _run_analysis_pipeline(video_path, profile)
276
  finally:
277
  if video_path is not None:
278
  Path(video_path).unlink(missing_ok=True)
 
303
 
304
  def worker() -> None:
305
  try:
306
+ result = _run_analysis_pipeline(video_path, profile, events.put)
 
 
 
 
307
  events.put({"type": "complete", "result": _analysis_response(result)})
308
  except Exception as exc: # pragma: no cover - surfaced to browser clients
309
  events.put({"type": "error", "detail": str(exc)})
pyproject.toml CHANGED
@@ -16,6 +16,7 @@ dependencies = [
16
  # HF Spaces installs gradio[mcp,oauth], which requires pydantic<=2.12.5.
17
  "pydantic>=2.11.10,<=2.12.5",
18
  "scikit-learn>=1.4.0",
 
19
  "torch==2.11.0",
20
  ]
21
 
 
16
  # HF Spaces installs gradio[mcp,oauth], which requires pydantic<=2.12.5.
17
  "pydantic>=2.11.10,<=2.12.5",
18
  "scikit-learn>=1.4.0",
19
+ "spaces>=0.40.0",
20
  "torch==2.11.0",
21
  ]
22
 
requirements.txt CHANGED
@@ -36,8 +36,11 @@ certifi==2026.5.20
36
  # httpx
37
  # mediapipe
38
  # modal
 
39
  cffi==2.0.0
40
  # via sounddevice
 
 
41
  click==8.4.1
42
  # via
43
  # huggingface-hub
@@ -84,7 +87,9 @@ fsspec==2026.4.0
84
  # huggingface-hub
85
  # torch
86
  gradio==6.17.3
87
- # via pozify
 
 
88
  gradio-client==2.5.0
89
  # via
90
  # gradio
@@ -113,6 +118,7 @@ httpx==0.28.1
113
  # gradio-client
114
  # huggingface-hub
115
  # safehttpx
 
116
  huggingface-hub==1.18.0
117
  # via
118
  # gradio
@@ -124,6 +130,7 @@ idna==3.18
124
  # via
125
  # anyio
126
  # httpx
 
127
  # yarl
128
  jinja2==3.1.6
129
  # via
@@ -225,6 +232,7 @@ packaging==26.2
225
  # gradio-client
226
  # huggingface-hub
227
  # matplotlib
 
228
  pandas==2.3.3 ; python_full_version < '3.11' or python_full_version >= '3.14'
229
  # via gradio
230
  pandas==3.0.3 ; python_full_version >= '3.11' and python_full_version < '3.14'
@@ -246,6 +254,7 @@ pydantic==2.12.5
246
  # fastapi
247
  # gradio
248
  # pozify
 
249
  pydantic-core==2.41.5
250
  # via pydantic
251
  pydub==0.25.1
@@ -268,6 +277,8 @@ pyyaml==6.0.3
268
  # via
269
  # gradio
270
  # huggingface-hub
 
 
271
  rich==15.0.0
272
  # via
273
  # modal
@@ -292,6 +303,8 @@ six==1.17.0
292
  # via python-dateutil
293
  sounddevice==0.5.5
294
  # via mediapipe
 
 
295
  starlette==1.2.1
296
  # via
297
  # fastapi
@@ -335,6 +348,7 @@ typing-extensions==4.15.0
335
  # multidict
336
  # pydantic
337
  # pydantic-core
 
338
  # starlette
339
  # synchronicity
340
  # torch
@@ -346,6 +360,8 @@ typing-inspection==0.4.2
346
  # pydantic
347
  tzdata==2026.2 ; python_full_version < '3.11' or python_full_version >= '3.14' or sys_platform == 'emscripten' or sys_platform == 'win32'
348
  # via pandas
 
 
349
  uvicorn==0.49.0
350
  # via gradio
351
  watchfiles==1.2.0
 
36
  # httpx
37
  # mediapipe
38
  # modal
39
+ # requests
40
  cffi==2.0.0
41
  # via sounddevice
42
+ charset-normalizer==3.4.7
43
+ # via requests
44
  click==8.4.1
45
  # via
46
  # huggingface-hub
 
87
  # huggingface-hub
88
  # torch
89
  gradio==6.17.3
90
+ # via
91
+ # pozify
92
+ # spaces
93
  gradio-client==2.5.0
94
  # via
95
  # gradio
 
118
  # gradio-client
119
  # huggingface-hub
120
  # safehttpx
121
+ # spaces
122
  huggingface-hub==1.18.0
123
  # via
124
  # gradio
 
130
  # via
131
  # anyio
132
  # httpx
133
+ # requests
134
  # yarl
135
  jinja2==3.1.6
136
  # via
 
232
  # gradio-client
233
  # huggingface-hub
234
  # matplotlib
235
+ # spaces
236
  pandas==2.3.3 ; python_full_version < '3.11' or python_full_version >= '3.14'
237
  # via gradio
238
  pandas==3.0.3 ; python_full_version >= '3.11' and python_full_version < '3.14'
 
254
  # fastapi
255
  # gradio
256
  # pozify
257
+ # spaces
258
  pydantic-core==2.41.5
259
  # via pydantic
260
  pydub==0.25.1
 
277
  # via
278
  # gradio
279
  # huggingface-hub
280
+ requests==2.34.2
281
+ # via spaces
282
  rich==15.0.0
283
  # via
284
  # modal
 
303
  # via python-dateutil
304
  sounddevice==0.5.5
305
  # via mediapipe
306
+ spaces==0.50.4
307
+ # via pozify
308
  starlette==1.2.1
309
  # via
310
  # fastapi
 
348
  # multidict
349
  # pydantic
350
  # pydantic-core
351
+ # spaces
352
  # starlette
353
  # synchronicity
354
  # torch
 
360
  # pydantic
361
  tzdata==2026.2 ; python_full_version < '3.11' or python_full_version >= '3.14' or sys_platform == 'emscripten' or sys_platform == 'win32'
362
  # via pandas
363
+ urllib3==2.7.0
364
+ # via requests
365
  uvicorn==0.49.0
366
  # via gradio
367
  watchfiles==1.2.0
src/pozify/hf_spaces.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ from typing import Any, Callable, TypeVar, cast
5
+
6
+
7
+ F = TypeVar("F", bound=Callable[..., Any])
8
+ SPACES_GPU_DURATION_ENV = "POZIFY_SPACES_GPU_DURATION"
9
+ ROUTER_DEVICE_ENV = "POZIFY_ROUTER_DEVICE"
10
+
11
+
12
+ def _env_truthy(value: str | None) -> bool:
13
+ if value is None:
14
+ return False
15
+ return value.strip().lower() in {"1", "true", "yes", "on"}
16
+
17
+
18
+ def zero_gpu_enabled() -> bool:
19
+ if _env_truthy(os.getenv("SPACES_ZERO_GPU")):
20
+ return True
21
+
22
+ try:
23
+ from spaces.zero import Config
24
+ except Exception:
25
+ return False
26
+
27
+ return bool(getattr(Config, "zero_gpu", False))
28
+
29
+
30
+ def router_torch_device() -> str:
31
+ configured_device = os.getenv(ROUTER_DEVICE_ENV)
32
+ if configured_device:
33
+ return configured_device.strip().lower()
34
+ return "cuda" if zero_gpu_enabled() else "cpu"
35
+
36
+
37
+ def spaces_gpu(*, duration: Any = None, size: str | None = None) -> Callable[[F], F]:
38
+ try:
39
+ import spaces
40
+ except Exception:
41
+ return lambda function: function
42
+
43
+ gpu = getattr(spaces, "GPU", None)
44
+ if not callable(gpu):
45
+ return lambda function: function
46
+
47
+ def decorator(function: F) -> F:
48
+ if duration is None and size is None:
49
+ return cast(F, gpu(function))
50
+ return cast(F, gpu(duration=duration, size=size)(function))
51
+
52
+ return decorator
53
+
54
+
55
+ def default_spaces_gpu_duration() -> int:
56
+ configured_duration = os.getenv(SPACES_GPU_DURATION_ENV)
57
+ if configured_duration:
58
+ try:
59
+ return max(1, int(configured_duration))
60
+ except ValueError:
61
+ return 120
62
+ return 120
src/pozify/ml/exercise_router_inference.py CHANGED
@@ -8,6 +8,7 @@ from typing import Any
8
 
9
  import numpy as np
10
 
 
11
  from pozify.ml.exercise_router_features import ROUTER_LABELS, RouterWindow
12
  from pozify.ml.exercise_router_temporal import TorchTemporalRouter
13
 
@@ -162,7 +163,11 @@ def _load_temporal_router_model_file(path: Path) -> RouterModelBundle:
162
 
163
  checkpoint = torch.load(path, map_location="cpu", weights_only=False)
164
  labels = _labels_from_artifact(checkpoint.get("labels"), checkpoint)
165
- model = TorchTemporalRouter(checkpoint=checkpoint, labels=labels)
 
 
 
 
166
  return RouterModelBundle(
167
  model=model,
168
  labels=labels,
 
8
 
9
  import numpy as np
10
 
11
+ from pozify.hf_spaces import router_torch_device
12
  from pozify.ml.exercise_router_features import ROUTER_LABELS, RouterWindow
13
  from pozify.ml.exercise_router_temporal import TorchTemporalRouter
14
 
 
163
 
164
  checkpoint = torch.load(path, map_location="cpu", weights_only=False)
165
  labels = _labels_from_artifact(checkpoint.get("labels"), checkpoint)
166
+ model = TorchTemporalRouter(
167
+ checkpoint=checkpoint,
168
+ labels=labels,
169
+ device=router_torch_device(),
170
+ )
171
  return RouterModelBundle(
172
  model=model,
173
  labels=labels,
src/pozify/steps/pose_backends/mediapipe.py CHANGED
@@ -5,6 +5,7 @@ from pathlib import Path
5
  from typing import Any
6
  from urllib.request import urlretrieve
7
 
 
8
  from pozify.steps.pose_backends.base import PoseDetection
9
  from pozify.steps.pose_backends.landmarks import landmark_list_to_dict
10
 
@@ -75,9 +76,19 @@ class _MediaPipeTasksPoseAdapter:
75
  self._landmarker = self._create_landmarker(model_path)
76
 
77
  def _create_landmarker(self, model_path: Path) -> Any:
 
 
 
 
 
 
 
 
 
 
78
  base_options = self._mp.tasks.BaseOptions(
79
  model_asset_path=str(model_path),
80
- delegate=self._mp.tasks.BaseOptions.Delegate.CPU,
81
  )
82
  options = self._mp.tasks.vision.PoseLandmarkerOptions(
83
  base_options=base_options,
@@ -89,6 +100,16 @@ class _MediaPipeTasksPoseAdapter:
89
  )
90
  return self._mp.tasks.vision.PoseLandmarker.create_from_options(options)
91
 
 
 
 
 
 
 
 
 
 
 
92
  def process(self, rgb_frame: Any) -> Any:
93
  image = self._mp.Image(image_format=self._mp.ImageFormat.SRGB, data=rgb_frame)
94
  result = self._landmarker.detect(image)
 
5
  from typing import Any
6
  from urllib.request import urlretrieve
7
 
8
+ from pozify.hf_spaces import zero_gpu_enabled
9
  from pozify.steps.pose_backends.base import PoseDetection
10
  from pozify.steps.pose_backends.landmarks import landmark_list_to_dict
11
 
 
76
  self._landmarker = self._create_landmarker(model_path)
77
 
78
  def _create_landmarker(self, model_path: Path) -> Any:
79
+ delegate = self._preferred_delegate()
80
+ try:
81
+ return self._create_landmarker_with_delegate(model_path, delegate)
82
+ except Exception:
83
+ cpu_delegate = self._cpu_delegate()
84
+ if delegate == cpu_delegate:
85
+ raise
86
+ return self._create_landmarker_with_delegate(model_path, cpu_delegate)
87
+
88
+ def _create_landmarker_with_delegate(self, model_path: Path, delegate: Any) -> Any:
89
  base_options = self._mp.tasks.BaseOptions(
90
  model_asset_path=str(model_path),
91
+ delegate=delegate,
92
  )
93
  options = self._mp.tasks.vision.PoseLandmarkerOptions(
94
  base_options=base_options,
 
100
  )
101
  return self._mp.tasks.vision.PoseLandmarker.create_from_options(options)
102
 
103
+ def _preferred_delegate(self) -> Any:
104
+ if not zero_gpu_enabled():
105
+ return self._cpu_delegate()
106
+
107
+ delegate = self._mp.tasks.BaseOptions.Delegate
108
+ return getattr(delegate, "GPU", self._cpu_delegate())
109
+
110
+ def _cpu_delegate(self) -> Any:
111
+ return self._mp.tasks.BaseOptions.Delegate.CPU
112
+
113
  def process(self, rgb_frame: Any) -> Any:
114
  image = self._mp.Image(image_format=self._mp.ImageFormat.SRGB, data=rgb_frame)
115
  result = self._landmarker.detect(image)
tests/test_hf_spaces.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import sys
5
+ from pathlib import Path
6
+ import unittest
7
+ from unittest.mock import patch
8
+
9
+
10
+ sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
11
+
12
+ from pozify.hf_spaces import router_torch_device, zero_gpu_enabled
13
+
14
+
15
+ class HfSpacesRuntimeTests(unittest.TestCase):
16
+ def test_cpu_is_default_runtime_device(self) -> None:
17
+ with patch.dict(os.environ, {}, clear=True):
18
+ self.assertFalse(zero_gpu_enabled())
19
+ self.assertEqual(router_torch_device(), "cpu")
20
+
21
+ def test_zero_gpu_selects_cuda_runtime_device(self) -> None:
22
+ with patch.dict(os.environ, {"SPACES_ZERO_GPU": "1"}, clear=True):
23
+ self.assertTrue(zero_gpu_enabled())
24
+ self.assertEqual(router_torch_device(), "cuda")
25
+
26
+ def test_explicit_router_device_overrides_zero_gpu_default(self) -> None:
27
+ with patch.dict(
28
+ os.environ,
29
+ {"SPACES_ZERO_GPU": "1", "POZIFY_ROUTER_DEVICE": "cpu"},
30
+ clear=True,
31
+ ):
32
+ self.assertEqual(router_torch_device(), "cpu")
33
+
34
+
35
+ if __name__ == "__main__":
36
+ unittest.main()
tests/test_pose_steps.py CHANGED
@@ -20,6 +20,7 @@ sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
20
  from pozify.contracts import PoseFrame, PoseSequence, VideoManifest
21
  from pozify.steps import pose_cleaning, pose_landmarker
22
  from pozify.steps.pose_backends import PoseDetection, landmark_list_to_dict
 
23
 
24
 
25
  def _landmark(
@@ -226,5 +227,66 @@ class PoseStepTests(unittest.TestCase):
226
  self.assertTrue(cleaned.normalized)
227
 
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  if __name__ == "__main__":
230
  unittest.main()
 
20
  from pozify.contracts import PoseFrame, PoseSequence, VideoManifest
21
  from pozify.steps import pose_cleaning, pose_landmarker
22
  from pozify.steps.pose_backends import PoseDetection, landmark_list_to_dict
23
+ from pozify.steps.pose_backends.mediapipe import _MediaPipeTasksPoseAdapter
24
 
25
 
26
  def _landmark(
 
227
  self.assertTrue(cleaned.normalized)
228
 
229
 
230
+ class MediaPipeTasksDelegateTests(unittest.TestCase):
231
+ def _fake_mediapipe(self, *, fail_gpu: bool = False) -> SimpleNamespace:
232
+ class Delegate:
233
+ CPU = "cpu"
234
+ GPU = "gpu"
235
+
236
+ class BaseOptions:
237
+ def __init__(self, *, model_asset_path: str, delegate: str) -> None:
238
+ self.model_asset_path = model_asset_path
239
+ self.delegate = delegate
240
+
241
+ BaseOptions.Delegate = Delegate
242
+
243
+ class PoseLandmarkerOptions:
244
+ def __init__(self, *, base_options: BaseOptions, **_kwargs: object) -> None:
245
+ self.base_options = base_options
246
+
247
+ class PoseLandmarker:
248
+ @staticmethod
249
+ def create_from_options(options: PoseLandmarkerOptions) -> object:
250
+ if fail_gpu and options.base_options.delegate == "gpu":
251
+ raise RuntimeError("gpu delegate unavailable")
252
+ return SimpleNamespace(delegate=options.base_options.delegate)
253
+
254
+ return SimpleNamespace(
255
+ tasks=SimpleNamespace(
256
+ BaseOptions=BaseOptions,
257
+ vision=SimpleNamespace(
258
+ PoseLandmarkerOptions=PoseLandmarkerOptions,
259
+ PoseLandmarker=PoseLandmarker,
260
+ RunningMode=SimpleNamespace(IMAGE="image"),
261
+ ),
262
+ )
263
+ )
264
+
265
+ def _adapter(self, fake_mediapipe: SimpleNamespace) -> _MediaPipeTasksPoseAdapter:
266
+ adapter = object.__new__(_MediaPipeTasksPoseAdapter)
267
+ adapter._mp = fake_mediapipe
268
+ return adapter
269
+
270
+ def test_mediapipe_tasks_prefers_cpu_outside_zero_gpu(self) -> None:
271
+ adapter = self._adapter(self._fake_mediapipe())
272
+
273
+ with patch.dict(os.environ, {}, clear=True):
274
+ self.assertEqual(adapter._preferred_delegate(), "cpu")
275
+
276
+ def test_mediapipe_tasks_prefers_gpu_inside_zero_gpu(self) -> None:
277
+ adapter = self._adapter(self._fake_mediapipe())
278
+
279
+ with patch.dict(os.environ, {"SPACES_ZERO_GPU": "1"}, clear=True):
280
+ self.assertEqual(adapter._preferred_delegate(), "gpu")
281
+
282
+ def test_mediapipe_tasks_falls_back_to_cpu_when_gpu_delegate_fails(self) -> None:
283
+ adapter = self._adapter(self._fake_mediapipe(fail_gpu=True))
284
+
285
+ with patch.dict(os.environ, {"SPACES_ZERO_GPU": "1"}, clear=True):
286
+ landmarker = adapter._create_landmarker(Path("pose.task"))
287
+
288
+ self.assertEqual(landmarker.delegate, "cpu")
289
+
290
+
291
  if __name__ == "__main__":
292
  unittest.main()
uv.lock CHANGED
@@ -809,7 +809,7 @@ name = "cuda-bindings"
809
  version = "13.3.1"
810
  source = { registry = "https://pypi.org/simple" }
811
  dependencies = [
812
- { name = "cuda-pathfinder" },
813
  ]
814
  wheels = [
815
  { url = "https://files.pythonhosted.org/packages/a9/21/8464d133752951c154feafb3b65c297e7d80f301183d220bec4c830f1441/cuda_bindings-13.3.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:120fcc53d57903df529c3486962c56528cba5b7d6c57c99537320ed9922c8b86", size = 6073403, upload-time = "2026-05-29T23:11:36.22Z" },
@@ -844,37 +844,37 @@ wheels = [
844
 
845
  [package.optional-dependencies]
846
  cublas = [
847
- { name = "nvidia-cublas", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
848
  ]
849
  cudart = [
850
- { name = "nvidia-cuda-runtime", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
851
  ]
852
  cufft = [
853
- { name = "nvidia-cufft", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
854
  ]
855
  cufile = [
856
  { name = "nvidia-cufile", marker = "sys_platform == 'linux'" },
857
  ]
858
  cupti = [
859
- { name = "nvidia-cuda-cupti", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
860
  ]
861
  curand = [
862
- { name = "nvidia-curand", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
863
  ]
864
  cusolver = [
865
- { name = "nvidia-cusolver", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
866
  ]
867
  cusparse = [
868
- { name = "nvidia-cusparse", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
869
  ]
870
  nvjitlink = [
871
- { name = "nvidia-nvjitlink", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
872
  ]
873
  nvrtc = [
874
- { name = "nvidia-cuda-nvrtc", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
875
  ]
876
  nvtx = [
877
- { name = "nvidia-nvtx", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
878
  ]
879
 
880
  [[package]]
@@ -2043,7 +2043,7 @@ name = "nvidia-cudnn-cu13"
2043
  version = "9.19.0.56"
2044
  source = { registry = "https://pypi.org/simple" }
2045
  dependencies = [
2046
- { name = "nvidia-cublas" },
2047
  ]
2048
  wheels = [
2049
  { url = "https://files.pythonhosted.org/packages/f1/84/26025437c1e6b61a707442184fa0c03d083b661adf3a3eecfd6d21677740/nvidia_cudnn_cu13-9.19.0.56-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:6ed29ffaee1176c612daf442e4dd6cfeb6a0caa43ddcbeb59da94953030b1be4", size = 433781201, upload-time = "2026-02-03T20:40:53.805Z" },
@@ -2055,7 +2055,7 @@ name = "nvidia-cufft"
2055
  version = "12.0.0.61"
2056
  source = { registry = "https://pypi.org/simple" }
2057
  dependencies = [
2058
- { name = "nvidia-nvjitlink" },
2059
  ]
2060
  wheels = [
2061
  { url = "https://files.pythonhosted.org/packages/8b/ae/f417a75c0259e85c1d2f83ca4e960289a5f814ed0cea74d18c353d3e989d/nvidia_cufft-12.0.0.61-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2708c852ef8cd89d1d2068bdbece0aa188813a0c934db3779b9b1faa8442e5f5", size = 214053554, upload-time = "2025-09-04T08:31:38.196Z" },
@@ -2085,9 +2085,9 @@ name = "nvidia-cusolver"
2085
  version = "12.0.4.66"
2086
  source = { registry = "https://pypi.org/simple" }
2087
  dependencies = [
2088
- { name = "nvidia-cublas" },
2089
- { name = "nvidia-cusparse" },
2090
- { name = "nvidia-nvjitlink" },
2091
  ]
2092
  wheels = [
2093
  { url = "https://files.pythonhosted.org/packages/c8/c3/b30c9e935fc01e3da443ec0116ed1b2a009bb867f5324d3f2d7e533e776b/nvidia_cusolver-12.0.4.66-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:02c2457eaa9e39de20f880f4bd8820e6a1cfb9f9a34f820eb12a155aa5bc92d2", size = 223467760, upload-time = "2025-09-04T08:33:04.222Z" },
@@ -2099,7 +2099,7 @@ name = "nvidia-cusparse"
2099
  version = "12.6.3.3"
2100
  source = { registry = "https://pypi.org/simple" }
2101
  dependencies = [
2102
- { name = "nvidia-nvjitlink" },
2103
  ]
2104
  wheels = [
2105
  { url = "https://files.pythonhosted.org/packages/f8/94/5c26f33738ae35276672f12615a64bd008ed5be6d1ebcb23579285d960a9/nvidia_cusparse-12.6.3.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:80bcc4662f23f1054ee334a15c72b8940402975e0eab63178fc7e670aa59472c", size = 162155568, upload-time = "2025-09-04T08:33:42.864Z" },
@@ -2535,6 +2535,7 @@ dependencies = [
2535
  { name = "pydantic" },
2536
  { name = "scikit-learn", version = "1.7.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },
2537
  { name = "scikit-learn", version = "1.9.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },
 
2538
  { name = "torch" },
2539
  ]
2540
 
@@ -2560,6 +2561,7 @@ requires-dist = [
2560
  { name = "pydantic", specifier = ">=2.11.10,<=2.12.5" },
2561
  { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.5.0" },
2562
  { name = "scikit-learn", specifier = ">=1.4.0" },
 
2563
  { name = "torch", specifier = "==2.11.0" },
2564
  ]
2565
  provides-extras = ["dev", "train"]
@@ -3410,6 +3412,23 @@ wheels = [
3410
  { url = "https://files.pythonhosted.org/packages/4e/39/a61d4b83a7746b70d23d9173be688c0c6bfc7173772344b7442c2c155497/sounddevice-0.5.5-py3-none-win_arm64.whl", hash = "sha256:3861901ddd8230d2e0e8ae62ac320cdd4c688d81df89da036dcb812f757bb3e6", size = 317115, upload-time = "2026-01-23T18:36:42.235Z" },
3411
  ]
3412
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3413
  [[package]]
3414
  name = "starlette"
3415
  version = "1.2.1"
 
809
  version = "13.3.1"
810
  source = { registry = "https://pypi.org/simple" }
811
  dependencies = [
812
+ { name = "cuda-pathfinder", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
813
  ]
814
  wheels = [
815
  { url = "https://files.pythonhosted.org/packages/a9/21/8464d133752951c154feafb3b65c297e7d80f301183d220bec4c830f1441/cuda_bindings-13.3.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:120fcc53d57903df529c3486962c56528cba5b7d6c57c99537320ed9922c8b86", size = 6073403, upload-time = "2026-05-29T23:11:36.22Z" },
 
844
 
845
  [package.optional-dependencies]
846
  cublas = [
847
+ { name = "nvidia-cublas", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
848
  ]
849
  cudart = [
850
+ { name = "nvidia-cuda-runtime", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
851
  ]
852
  cufft = [
853
+ { name = "nvidia-cufft", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
854
  ]
855
  cufile = [
856
  { name = "nvidia-cufile", marker = "sys_platform == 'linux'" },
857
  ]
858
  cupti = [
859
+ { name = "nvidia-cuda-cupti", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
860
  ]
861
  curand = [
862
+ { name = "nvidia-curand", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
863
  ]
864
  cusolver = [
865
+ { name = "nvidia-cusolver", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
866
  ]
867
  cusparse = [
868
+ { name = "nvidia-cusparse", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
869
  ]
870
  nvjitlink = [
871
+ { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
872
  ]
873
  nvrtc = [
874
+ { name = "nvidia-cuda-nvrtc", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
875
  ]
876
  nvtx = [
877
+ { name = "nvidia-nvtx", marker = "(python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or sys_platform == 'linux'" },
878
  ]
879
 
880
  [[package]]
 
2043
  version = "9.19.0.56"
2044
  source = { registry = "https://pypi.org/simple" }
2045
  dependencies = [
2046
+ { name = "nvidia-cublas", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
2047
  ]
2048
  wheels = [
2049
  { url = "https://files.pythonhosted.org/packages/f1/84/26025437c1e6b61a707442184fa0c03d083b661adf3a3eecfd6d21677740/nvidia_cudnn_cu13-9.19.0.56-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:6ed29ffaee1176c612daf442e4dd6cfeb6a0caa43ddcbeb59da94953030b1be4", size = 433781201, upload-time = "2026-02-03T20:40:53.805Z" },
 
2055
  version = "12.0.0.61"
2056
  source = { registry = "https://pypi.org/simple" }
2057
  dependencies = [
2058
+ { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
2059
  ]
2060
  wheels = [
2061
  { url = "https://files.pythonhosted.org/packages/8b/ae/f417a75c0259e85c1d2f83ca4e960289a5f814ed0cea74d18c353d3e989d/nvidia_cufft-12.0.0.61-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2708c852ef8cd89d1d2068bdbece0aa188813a0c934db3779b9b1faa8442e5f5", size = 214053554, upload-time = "2025-09-04T08:31:38.196Z" },
 
2085
  version = "12.0.4.66"
2086
  source = { registry = "https://pypi.org/simple" }
2087
  dependencies = [
2088
+ { name = "nvidia-cublas", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
2089
+ { name = "nvidia-cusparse", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
2090
+ { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
2091
  ]
2092
  wheels = [
2093
  { url = "https://files.pythonhosted.org/packages/c8/c3/b30c9e935fc01e3da443ec0116ed1b2a009bb867f5324d3f2d7e533e776b/nvidia_cusolver-12.0.4.66-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:02c2457eaa9e39de20f880f4bd8820e6a1cfb9f9a34f820eb12a155aa5bc92d2", size = 223467760, upload-time = "2025-09-04T08:33:04.222Z" },
 
2099
  version = "12.6.3.3"
2100
  source = { registry = "https://pypi.org/simple" }
2101
  dependencies = [
2102
+ { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.11' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.11' and sys_platform == 'win32') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'darwin' and sys_platform != 'emscripten' and sys_platform != 'win32')" },
2103
  ]
2104
  wheels = [
2105
  { url = "https://files.pythonhosted.org/packages/f8/94/5c26f33738ae35276672f12615a64bd008ed5be6d1ebcb23579285d960a9/nvidia_cusparse-12.6.3.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:80bcc4662f23f1054ee334a15c72b8940402975e0eab63178fc7e670aa59472c", size = 162155568, upload-time = "2025-09-04T08:33:42.864Z" },
 
2535
  { name = "pydantic" },
2536
  { name = "scikit-learn", version = "1.7.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },
2537
  { name = "scikit-learn", version = "1.9.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" },
2538
+ { name = "spaces" },
2539
  { name = "torch" },
2540
  ]
2541
 
 
2561
  { name = "pydantic", specifier = ">=2.11.10,<=2.12.5" },
2562
  { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.5.0" },
2563
  { name = "scikit-learn", specifier = ">=1.4.0" },
2564
+ { name = "spaces", specifier = ">=0.40.0" },
2565
  { name = "torch", specifier = "==2.11.0" },
2566
  ]
2567
  provides-extras = ["dev", "train"]
 
3412
  { url = "https://files.pythonhosted.org/packages/4e/39/a61d4b83a7746b70d23d9173be688c0c6bfc7173772344b7442c2c155497/sounddevice-0.5.5-py3-none-win_arm64.whl", hash = "sha256:3861901ddd8230d2e0e8ae62ac320cdd4c688d81df89da036dcb812f757bb3e6", size = 317115, upload-time = "2026-01-23T18:36:42.235Z" },
3413
  ]
3414
 
3415
+ [[package]]
3416
+ name = "spaces"
3417
+ version = "0.50.4"
3418
+ source = { registry = "https://pypi.org/simple" }
3419
+ dependencies = [
3420
+ { name = "gradio" },
3421
+ { name = "httpx" },
3422
+ { name = "packaging" },
3423
+ { name = "pydantic" },
3424
+ { name = "requests" },
3425
+ { name = "typing-extensions" },
3426
+ ]
3427
+ sdist = { url = "https://files.pythonhosted.org/packages/7f/9d/9a06c91f01ed57ac4749e00f8eaf591ed5e3c6ec7c4499ce5c6f59fbc1dc/spaces-0.50.4.tar.gz", hash = "sha256:0aaed1d041d21c35c14b5a5cee5be677ad0ea26a26a5f09c488264ab1c031753", size = 88304, upload-time = "2026-06-04T15:41:13.17Z" }
3428
+ wheels = [
3429
+ { url = "https://files.pythonhosted.org/packages/c5/01/e02d0352836c68bd9e307c369c62800c9437d6243e64e1d8660543e50617/spaces-0.50.4-py3-none-any.whl", hash = "sha256:ad4383748b7a4219940d9ba786bb3eebbbd9cc946d21334bee1557bb20469355", size = 111340, upload-time = "2026-06-04T15:41:11.732Z" },
3430
+ ]
3431
+
3432
  [[package]]
3433
  name = "starlette"
3434
  version = "1.2.1"