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

Add MultipleChoice & QuestionAnswering heads to ModernBERT #35825

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

warner-benjamin
Copy link
Contributor

This PR adds the ForQuestionAnswering and ForMultipleChoice heads to ModernBERT. It also updates the existing heads to use the self.loss_function loss implementations where one exists.

At the moment I have removed the full model sequence packing inputs from the ModernBertForMultipleChoice head, as I don't think we can guarantee they would be correct post flattening. I think it would be better to have ModernBertBase handle unpadding for this head to reduce complexity and edge cases.

cc @ArthurZucker, @tomaarsen

@Rocketknight1
Copy link
Member

Hi @warner-benjamin, we already have a PR for the QuestionAnswering head at #35566, which should have been merged by now, but I'm slow at reviewing

We definitely appreciate the MultipleChoice head, though - if you can trim this PR to just add that, I'd be happy to review/accept it!

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.

3 participants