ITADN

CI fails with transformers v5.0.0: AttributeError: 'GptOssConfig' object has no attribute 'num_experts'

#5754Closedalbertvillanova 创建于 2026-05-12
A
albertvillanovacommented
CI fails with transformers v5.0.0: ```python FAILED tests/test_sft_trainer.py::TestPatchChunkedCELMHead::test_forward_matches_reference_with_aux_loss[trl-internal-testing/tiny-GptOssForCausalLM] - AttributeError: 'GptOssConfig' object has no attribute 'num_experts' ``` Stacktrace: ```python > out = chunked_model(input_ids=input_ids, labels=labels, num_items_in_batch=num_items) tests/test_sft_trainer.py:2534: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .venv/lib/python3.10/site-packages/torch/nn/modules/module.py:1775: in _wrapped_call_impl return self._call_impl(*args, **kwargs) .venv/lib/python3.10/site-packages/torch/nn/modules/module.py:1786: in _call_impl return forward_call(*args, **kwargs) trl/trainer/sft_trainer.py:311: in _chunked_ce_forward num_experts = text_config.num_experts _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = GptOssConfig { "architectures": [ "GptOssForCausalLM" ], "attention_bias": true, "attention_dropout": 0.0,... 128, "tie_word_embeddings": false, "transformers_version": "5.0.0", "use_cache": true, "vocab_size": 200019 } key = 'num_experts' def __getattribute__(self, key): if key != "attribute_map" and key in super().__getattribute__("attribute_map"): key = super().__getattribute__("attribute_map")[key] > return super().__getattribute__(key) E AttributeError: 'GptOssConfig' object has no attribute 'num_experts' ../transformers/src/transformers/configuration_utils.py:164: AttributeError ```
关闭于 2026-05-15 1 条评论