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

[enh] Throw error if StaticEmbedding-based model is trained with incompatible loss #2990

Merged

Conversation

tomaarsen
Copy link
Collaborator

Resolves #2982

Hello!

Pull Request overview

  • Throw error if StaticEmbedding-based model is trained with incompatible loss

Details

Several losses rely on input_ids having a specific shape, etc., whereas the StaticEmbedding input_ids are concatenated to avoid any padding. This results in very fast inference, but prevents roughly ~5 losses from working. Luckily, there's still many good options, such as MultipleNegativesRankingLoss.

Big thanks to @aoezdTchibo for pointing this incompatibility out to me.

  • Tom Aarsen

@tomaarsen tomaarsen merged commit 72d5649 into UKPLab:master Oct 17, 2024
11 checks passed
@tomaarsen tomaarsen deleted the enh/static_embeddings_incompat_losses branch October 17, 2024 10:53
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

Successfully merging this pull request may close these issues.

Fine-tuning with StaticEmbedding and CachedMultipleNegativesRankingLoss not working
1 participant