Files
mlx-lm/tests
beceb5c16d Fix ArraysCache.from_state not initializing left_padding and lengths (#807)
* Fix ArraysCache.from_state not initializing left_padding and lengths

The base class from_state uses __new__ to bypass __init__, but
ArraysCache.state.setter only sets self.cache, not left_padding
or lengths. This causes AttributeError when using loaded caches
with models that use MambaCache (e.g., Qwen3-Next).

The fix overrides from_state in ArraysCache to properly initialize
these attributes before setting state.

* Add test

---------

Co-authored-by: Awni Hannun <[email protected]>
2026-01-25 06:46:35 -08:00
..
2025-09-15 16:02:45 -07:00
2025-03-13 15:37:13 -07:00
2025-12-02 13:33:11 -08:00
2026-01-22 07:35:58 -08:00
2025-03-13 15:37:13 -07:00