techfreakworm commited on
Commit
bf24895
·
unverified ·
1 Parent(s): a6e50a8

fix(deps): pin the model-load path to the versions the gate ran

Browse files

Minor-version ranges still let a rebuild pull packages nobody has run
with this code. The packages imported on the model-load path are now
pinned exactly to the Python 3.10 gate venv that drove the real XL SFT
pipeline: torchcodec 0.17.0, torchao 0.18.0, diffusers 0.39.0, peft
0.21.3, accelerate 1.15.0, vector-quantize-pytorch 1.34.1, numba 0.68.1,
huggingface_hub 0.36.2. Two new lines:

- torch-einops-utils==0.2.8: vector-quantize-pytorch 1.34.1 imports it
when the DiT's model code loads and does not bound it (29 releases
since September);
- hf_xet==1.8.0: hub 0.36.2 calls only hf_xet's legacy download API,
already deprecated in 1.8.

demucs goes to 4.0.1 on purpose: 4.1 fetches htdemucs from an unpinned
third-party HF repo first, 4.0.1 uses the fixed, hash-checked file.
torch stays a range (the platform preinstalls it), torchaudio stays
2.11.0, gradio and spaces stay unpinned, and no requirement line carries
a trailing comment (a ZeroGPU CONFIG_ERROR was blamed on one). The set
resolves for Linux cp310 with gradio[oauth,mcp]==6.14.0 and spaces, also
with the platform's torch at 2.11.0 or 2.12.1.

Files changed (2) hide show
  1. requirements.txt +22 -18
  2. tests/test_preload_repos.py +22 -9
requirements.txt CHANGED
@@ -6,15 +6,17 @@ torch>=2.11,<2.14
6
  # 2.11.1's binary needs torch >= 2.13 although its metadata says >= 2.11.
7
  torchaudio==2.11.0
8
  safetensors>=0.4
9
- # Upper bound at the minor verified in the local gate (LoRA loading in the fork).
10
- peft>=0.13,<0.22
11
- # Upper bound at the minor verified in the local gate (4.1 keeps get_model/apply_model).
12
- demucs>=4.0,<4.2
13
  pyloudnorm>=0.1.1
14
  soundfile>=0.13.1
15
  librosa>=0.10
16
- # transformers 4.57 needs >=0.34,<1.0; model_store relies on the 0.x snapshot_download API.
17
- huggingface_hub>=0.34,<1.0
 
 
18
  hf_transfer>=0.1.9
19
  numpy>=1.26,<2
20
  # --- ace-step's transitive deps (NOT installing ace-step itself; it's
@@ -22,25 +24,27 @@ numpy>=1.26,<2
22
  # pyproject pins nano-vllm; sys_platform != "darwin" which isn't on PyPI,
23
  # so we list ace-step's deps directly and bypass the pip install of the
24
  # package. app.py adds vendor/ace-step to sys.path before importing. ---
25
- # Upper bound at the minor verified in the local gate (0.40+ also needs huggingface_hub >= 1.23).
26
- diffusers<0.40
27
  matplotlib>=3.7.5
28
  scipy>=1.10.1
29
  loguru>=0.7.3
30
  einops>=0.8.1
31
- # Upper bound at the minor verified in the local gate (loaded by transformers and diffusers).
32
- accelerate>=1.12.0,<1.17
33
  fastapi>=0.110.0
34
  diskcache
35
  uvicorn[standard]>=0.27.0
36
- # Upper bound at the minor verified in the local gate (loaded with the ACE-Step handler).
37
- numba>=0.63.1,<0.69
38
- # Imported by the XL SFT model code at load and fast-moving: capped at the verified minor.
39
- vector-quantize-pytorch>=1.27.15,<1.35
40
- # Declares no torch requirement, so pip can't keep it in step with torch: capped at the verified minor.
41
- torchcodec>=0.12,<0.18
42
- # transformers and diffusers import its prototype API at load time: capped at the verified minor.
43
- torchao>=0.16,<0.19
 
 
44
  toml
45
  lightning>=2.0.0
46
  modelscope
 
6
  # 2.11.1's binary needs torch >= 2.13 although its metadata says >= 2.11.
7
  torchaudio==2.11.0
8
  safetensors>=0.4
9
+ # Exact version the gate ran (LoRA loading in the fork).
10
+ peft==0.21.3
11
+ # 4.1 fetches htdemucs from an unpinned third-party HF repo first; 4.0.1 uses the fixed, hash-checked file.
12
+ demucs==4.0.1
13
  pyloudnorm>=0.1.1
14
  soundfile>=0.13.1
15
  librosa>=0.10
16
+ # transformers 4.57 needs <1.0, and model_store relies on 0.36's snapshot_download: the gate's version.
17
+ huggingface_hub==0.36.2
18
+ # hub 0.36.2 calls only hf_xet's legacy download API (deprecated in 1.8): exact version the gate ran.
19
+ hf_xet==1.8.0
20
  hf_transfer>=0.1.9
21
  numpy>=1.26,<2
22
  # --- ace-step's transitive deps (NOT installing ace-step itself; it's
 
24
  # pyproject pins nano-vllm; sys_platform != "darwin" which isn't on PyPI,
25
  # so we list ace-step's deps directly and bypass the pip install of the
26
  # package. app.py adds vendor/ace-step to sys.path before importing. ---
27
+ # Exact version the gate ran (AutoencoderOobleck; 0.40+ also needs huggingface_hub >= 1.23).
28
+ diffusers==0.39.0
29
  matplotlib>=3.7.5
30
  scipy>=1.10.1
31
  loguru>=0.7.3
32
  einops>=0.8.1
33
+ # Exact version the gate ran (loaded by transformers and diffusers).
34
+ accelerate==1.15.0
35
  fastapi>=0.110.0
36
  diskcache
37
  uvicorn[standard]>=0.27.0
38
+ # Exact version the gate ran (loaded with the ACE-Step handler).
39
+ numba==0.68.1
40
+ # Imported by the XL SFT model code at load and fast-moving: exact version the gate ran.
41
+ vector-quantize-pytorch==1.34.1
42
+ # vector-quantize-pytorch 1.34.1 imports it without an upper bound (29 releases since September).
43
+ torch-einops-utils==0.2.8
44
+ # Declares no torch requirement, so pip can't keep it in step with torch: exact version the gate ran.
45
+ torchcodec==0.17.0
46
+ # transformers and diffusers import its prototype API at load time: exact version the gate ran.
47
+ torchao==0.18.0
48
  toml
49
  lightning>=2.0.0
50
  modelscope
tests/test_preload_repos.py CHANGED
@@ -195,18 +195,22 @@ def test_readme_rest_of_front_matter_is_unchanged():
195
 
196
  # --- requirements.txt (resolved by HF Spaces on every rebuild) --------------------
197
 
 
 
198
  _PINNED = [
199
  "torch>=2.11,<2.14",
200
  "torchaudio==2.11.0",
201
- "torchcodec>=0.12,<0.18",
202
- "torchao>=0.16,<0.19",
203
- "diffusers<0.40",
204
- "peft>=0.13,<0.22",
205
- "accelerate>=1.12.0,<1.17",
206
- "demucs>=4.0,<4.2",
207
- "vector-quantize-pytorch>=1.27.15,<1.35",
208
- "numba>=0.63.1,<0.69",
209
- "huggingface_hub>=0.34,<1.0",
 
 
210
  ]
211
 
212
 
@@ -233,6 +237,15 @@ def test_requirements_pin_the_torch_stack_and_model_load_path():
233
  assert above.startswith("# "), f"{spec} needs a one-line comment saying why"
234
  names = _requirement_names()
235
  assert names["torchaudio"] == "torchaudio==2.11.0" # 2.11.1's binary needs torch >= 2.13
 
 
 
 
 
 
 
 
 
236
 
237
 
238
  def test_requirements_leave_gradio_and_spaces_to_the_platform():
 
195
 
196
  # --- requirements.txt (resolved by HF Spaces on every rebuild) --------------------
197
 
198
+ # Exact versions the Python 3.10 gate ran on the model-load path (torch is a range:
199
+ # the platform preinstalls it, and ZeroGPU supports 2.11.0 / 2.12.1 / 2.13.0).
200
  _PINNED = [
201
  "torch>=2.11,<2.14",
202
  "torchaudio==2.11.0",
203
+ "torchcodec==0.17.0",
204
+ "torchao==0.18.0",
205
+ "diffusers==0.39.0",
206
+ "peft==0.21.3",
207
+ "accelerate==1.15.0",
208
+ "demucs==4.0.1",
209
+ "vector-quantize-pytorch==1.34.1",
210
+ "torch-einops-utils==0.2.8",
211
+ "numba==0.68.1",
212
+ "huggingface_hub==0.36.2",
213
+ "hf_xet==1.8.0",
214
  ]
215
 
216
 
 
237
  assert above.startswith("# "), f"{spec} needs a one-line comment saying why"
238
  names = _requirement_names()
239
  assert names["torchaudio"] == "torchaudio==2.11.0" # 2.11.1's binary needs torch >= 2.13
240
+ assert names["demucs"] == "demucs==4.0.1" # 4.1 fetches weights from an unpinned HF repo first
241
+ assert names["torch-einops-utils"] == "torch-einops-utils==0.2.8" # vq 1.34.1 does not bound it
242
+
243
+
244
+ def test_requirement_lines_carry_no_trailing_comments():
245
+ # Another ZeroGPU Space reported a CONFIG_ERROR blamed on an inline comment on the torch line.
246
+ for line in _requirement_lines():
247
+ if line.strip() and not line.lstrip().startswith("#"):
248
+ assert "#" not in line, line
249
 
250
 
251
  def test_requirements_leave_gradio_and_spaces_to_the_platform():