Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernBERT doesn't support Denoising Auto Encoder loss #3181

Open
zionsoumik opened this issue Jan 20, 2025 · 1 comment
Open

modernBERT doesn't support Denoising Auto Encoder loss #3181

zionsoumik opened this issue Jan 20, 2025 · 1 comment

Comments

@zionsoumik
Copy link

Getting error:

Model name or path "modernBERT" does not support being as a decoder. Please make sure the decoder model has an "XXXLMHead" class.

@tomaarsen

@tomaarsen
Copy link
Collaborator

Hello!

Indeed, the ModernBERT architecture implemented in transformers here: https://github.com/huggingface/transformers/blob/main/src/transformers/models/modernbert/modeling_modernbert.py
does not contain a decoder class (sometimes known as a ...LMHead class, which stands for Language Modeling Head). Because of this, we cannot create a decoder with ModernBERT, so it's not possible to use DenoisingAutoEncoderLoss with ModernBERT as the decoder (but you can use it as the encoder, and another model as the decoder).

I think a ModernBERT implementation for decoders is being worked on, but I'm not sure. Otherwise, the only solution is to implement this yourself, then registering it, and then you can use it as a decoder.

  • Tom Aarsen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants