Skip to content

missing pad_token_idx in StableLmConfig after 5.0 update #43572

@mario-aws

Description

@mario-aws

System Info

transformers 5.0.0
trainium 2
python 3.10
pytorch 2.9

Who can help?

@ArthurZucker @Cyrilvallez @itazap

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

  1. from transformers import StableLmConfig, AutoModelForCausalLM
  2. AutoModelForCausalLM.from_config(StableLmConfig())

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/shared/mmkrell/vscode/moduscope_ws/TorchNeuronEager/.venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 236, in from_config
    return model_class._from_config(config, **kwargs)
  File "/shared/mmkrell/vscode/moduscope_ws/TorchNeuronEager/.venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 1508, in _from_config
    model = cls(config, **kwargs)
  File "/shared/mmkrell/vscode/moduscope_ws/TorchNeuronEager/.venv/lib/python3.10/site-packages/transformers/models/stablelm/modeling_stablelm.py", line 702, in __init__
    self.model = StableLmModel(config)
  File "/shared/mmkrell/vscode/moduscope_ws/TorchNeuronEager/.venv/lib/python3.10/site-packages/transformers/models/stablelm/modeling_stablelm.py", line 464, in __init__
    self.padding_idx = config.pad_token_id
  File "/shared/mmkrell/vscode/moduscope_ws/TorchNeuronEager/.venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 164, in __getattribute__
    return super().__getattribute__(key)
AttributeError: 'StableLmConfig' object has no attribute 'pad_token_id'. Did you mean: 'bos_token_id'?

Expected behavior

Normal model creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions