Fixed bugs in JetMoE models.
What does this PR do?
Fixes issue #31791.
- Fixed bugs in JetMoE casual language model and sequence classification model.
- The original code will report errors when we want to output the
aux_loss, like described in the issue. - I have modified
JetMoeForCausalLMandJetMoeForSequenceClassification, now they work properly and outputaux_loss, - Meanwhile I have followed
MoeCausalLMOutputWithPastclass to write a new class namedMoESequenceClassifierOutputWithPastto store the results ofJetMoeForSequenceClassificationmodel. - The code have passed the test of
tests/models/jetmoe/test_modeling_jetmoe.py.
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [ ] Did you write any new necessary tests?
Who can review?
@ArthurZucker
ci/circleci: tests_torch_and_tf error doesn't seem to be a problem with the code I submitted.
The check_code_quality error can be fixed with this command:
ruff format src/transformers/models/jetmoe/modeling_jetmoe.py.
The tests_torch_and_tf will usually be automatically fixed after a resubmission.
The
check_code_qualityerror can be fixed with this command:ruff format src/transformers/models/jetmoe/modeling_jetmoe.py. Thetests_torch_and_tfwill usually be automatically fixed after a resubmission.
Thanks a lot, I have already formatted the files under your guidance.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.