transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Fixed bugs in JetMoE models.

Open Phoenix-Shen opened this issue 1 year ago • 4 comments

What does this PR do?

Fixes issue #31791.

  1. Fixed bugs in JetMoE casual language model and sequence classification model.
  2. The original code will report errors when we want to output the aux_loss, like described in the issue.
  3. I have modified JetMoeForCausalLM and JetMoeForSequenceClassification, now they work properly and output aux_loss,
  4. Meanwhile I have followed MoeCausalLMOutputWithPast class to write a new class named MoESequenceClassifierOutputWithPast to store the results of JetMoeForSequenceClassification model.
  5. 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

Phoenix-Shen avatar Jul 07 '24 05:07 Phoenix-Shen

ci/circleci: tests_torch_and_tf error doesn't seem to be a problem with the code I submitted.

Phoenix-Shen avatar Jul 07 '24 05:07 Phoenix-Shen

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.

yikangshen avatar Jul 08 '24 14:07 yikangshen

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.

Thanks a lot, I have already formatted the files under your guidance.

Phoenix-Shen avatar Jul 09 '24 10:07 Phoenix-Shen

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.

github-actions[bot] avatar Aug 06 '24 08:08 github-actions[bot]