Skip to content

Commit 2d9be57

Browse files
committed
deps: cap transformers<5.13 — 5.13.0 breaks mlx-lm import, killing every fresh install at model load (#136, #135)
transformers 5.13.0 changed AutoTokenizer.register to require a config class as the key; mlx-lm 0.31.x registers by name ("NewlineTokenizer"), so `import mlx_lm` raises AttributeError('str' has no '__module__') before any model can load. Every venv resolved after 5.13.0 shipped is dead on arrival — three independent reporters in 24h (#136 + 2 dupes, #135 is timing-consistent), and we hit the identical crash ourselves on 2026-07-03 and pinned the local venv manually (this makes the fix survive the app's fingerprint force-reinstall, which the manual pin did not). Marker-gated like the sibling mlx pins. Same content as PR #137 by @davidtai (verified: bisect 5.12.1 good / 5.13.0 bad matches our own finding). Wheel metadata verified: Requires-Dist: transformers<5.13 present in the built wheel. Drop the cap once mlx-lm registers the 5.13-compatible way (ml-explore/mlx-lm#1465).
1 parent 08905f8 commit 2d9be57

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ dependencies = [
1616
"huggingface-hub>=0.36",
1717
"mlx>=0.31,<0.32; sys_platform == 'darwin' and platform_machine == 'arm64'",
1818
"mlx-lm>=0.31,<0.32; sys_platform == 'darwin' and platform_machine == 'arm64'",
19+
# transformers 5.13.0 changed AutoTokenizer.register to require a config
20+
# class as the key; mlx-lm 0.31.x still registers by name
21+
# ("NewlineTokenizer") and crashes at import, killing every fresh install
22+
# at model load (#136, #135; PR #137 by @davidtai). Drop the cap once
23+
# mlx-lm registers the 5.13-compatible way (mlx-lm PR #1465).
24+
"transformers<5.13; sys_platform == 'darwin' and platform_machine == 'arm64'",
1925
"nanobind>=2; sys_platform == 'darwin' and platform_machine == 'arm64'",
2026
"numpy>=2",
2127
"pydantic>=2",

0 commit comments

Comments
 (0)