huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
132.95k stars 26.53k forks source link

get_input_embeddings return None in SpeechT5Model, which will make testcase failure #33527

Open sywangyi opened 2 weeks ago

sywangyi commented 2 weeks ago

System Info

Who can help?

@amyeroberts @ylacombe

Information

Tasks

Reproduction

see https://github.com/huggingface/transformers/pull/33194 which adds test test_peft_gradient_checkpointing_enable_disable.

pytest tests/models/speecht5/test_modeling_speecht5.py -k "peft"

FAILED tests/models/speecht5/test_modeling_speecht5.py::SpeechT5ModelTest::test_peft_gradient_checkpointing_enable_disable - AttributeError: 'NoneType' object has no attribute 'register_forward_hook' FAILED tests/models/speecht5/test_modeling_speecht5.py::SpeechT5ForSpeechToSpeechTest::test_peft_gradient_checkpointing_enable_disable - AttributeError: 'NoneType' object has no attribute 'register_forward_hook'

Expected behavior

test pass.

ylacombe commented 3 days ago

Hey @sywangyi, thanks for opening this issue! Would you be interesting to solve this and open a PR in that case?