Skip to content

Tokenizer loading fails for models with v5-style extra_special_tokens #661

Description

@DePasqualeOrg
$ mlx_lm.generate --model mlx-community/Ministral-3-3B-Reasoning-2512-4bit --prompt "Hello"

AttributeError: 'list' object has no attribute 'keys'

The model's tokenizer_config.json has extra_special_tokens as a list, but transformers v4.x expects a dict. transformers v5 changes this field to a list, and some models already use the new format.

Upgrading to transformers v5 (which requires some migration work) would resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions