Hard-pin transformers==4.57.1 (was >=5.6,<5.8)
Browse filesThe earlier 5.6/5.7/5.8 fixes were chasing the wrong target. The real
break happens **across the 4.x → 5.x boundary**: transformers 5.x
moved `config.rope_theta` into a `rope_parameters` dict and never
populates the top-level attribute, even when supplied via kwargs. The
upstream `modeling_qwen3.py` we vendor (commit df86ca9) reads
`config.rope_theta` directly, so on any 5.x the rotary frequencies
silently default — base attention still runs, but with wrong positions,
the gen tower output collapses, and 50-step sampling produces a flat
mid-grey image with patch-grid texture (everything else — model load,
LoRA wrap, ckpt inject, even `think_mode` text generation — succeeds
without warning).
This was masked because the venv was originally on 4.57.1 (May 1 - May 6)
where v16c sampling worked. The publish-cleanup commit relaxed
`transformers>=5.6` and a subsequent `pip install -e .` (May 7) silently
upgraded the local venv to 5.8.0, which is when sampling broke.
Hard-pin all three requirements specs to the exact 4.57.1 we know works.
The earlier 5.x compatibility shims (rope_theta auto-promotion,
all_tied_weights_keys, compute_default_rope_parameters method) stay in
the snapshot files as no-ops on 4.57.1; they only kick in if a future
user is on 5.x. Same for the loader.py self-heal for transformers'
indirect-import dynamic-cache miss.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- pyproject.toml +7 -4
- requirements.txt +4 -5
- train_u1/requirements.txt +1 -1
|
@@ -32,10 +32,13 @@ classifiers = [
|
|
| 32 |
]
|
| 33 |
dependencies = [
|
| 34 |
"torch>=2.9",
|
| 35 |
-
#
|
| 36 |
-
#
|
| 37 |
-
#
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
| 39 |
"safetensors>=0.7",
|
| 40 |
"huggingface_hub>=0.26",
|
| 41 |
"sentencepiece",
|
|
|
|
| 32 |
]
|
| 33 |
dependencies = [
|
| 34 |
"torch>=2.9",
|
| 35 |
+
# Hard-pin: the upstream `modeling_qwen3.py` we vendor (commit df86ca9)
|
| 36 |
+
# was written against transformers 4.57.1 and reads `config.rope_theta`
|
| 37 |
+
# directly. transformers 5.x moved that into a `rope_parameters` dict,
|
| 38 |
+
# which silently breaks attention frequencies and produces noise images
|
| 39 |
+
# at sample time even when the LoRA + base load cleanly. Stay on 4.57.1
|
| 40 |
+
# until we either re-train or rewrite the modeling files.
|
| 41 |
+
"transformers==4.57.1",
|
| 42 |
"safetensors>=0.7",
|
| 43 |
"huggingface_hub>=0.26",
|
| 44 |
"sentencepiece",
|
|
@@ -3,11 +3,10 @@
|
|
| 3 |
|
| 4 |
# core
|
| 5 |
torch>=2.9
|
| 6 |
-
#
|
| 7 |
-
#
|
| 8 |
-
#
|
| 9 |
-
|
| 10 |
-
transformers>=5.6,<5.8
|
| 11 |
safetensors>=0.7
|
| 12 |
|
| 13 |
# HF model load (NEOChatModel uses trust_remote_code)
|
|
|
|
| 3 |
|
| 4 |
# core
|
| 5 |
torch>=2.9
|
| 6 |
+
# Hard-pin: the upstream modeling_qwen3.py (commit df86ca9) reads
|
| 7 |
+
# `config.rope_theta` directly; transformers 5.x moved that into a
|
| 8 |
+
# `rope_parameters` dict, silently breaking attention freqs at sample time.
|
| 9 |
+
transformers==4.57.1
|
|
|
|
| 10 |
safetensors>=0.7
|
| 11 |
|
| 12 |
# HF model load (NEOChatModel uses trust_remote_code)
|
|
@@ -4,7 +4,7 @@
|
|
| 4 |
|
| 5 |
# core
|
| 6 |
torch>=2.9
|
| 7 |
-
transformers
|
| 8 |
safetensors>=0.7
|
| 9 |
|
| 10 |
# HF model load (NEOChatModel uses trust_remote_code)
|
|
|
|
| 4 |
|
| 5 |
# core
|
| 6 |
torch>=2.9
|
| 7 |
+
transformers==4.57.1 # upstream modeling_qwen3.py reads config.rope_theta directly; 5.x dict-form silently breaks attention
|
| 8 |
safetensors>=0.7
|
| 9 |
|
| 10 |
# HF model load (NEOChatModel uses trust_remote_code)
|