transformers icon indicating copy to clipboard operation
transformers copied to clipboard

GPT2ForQuestionAnswering

Open peter-sk opened this issue 2 years ago • 4 comments

What does this PR do?

Fixes # (issue)

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?
  • [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
  • [x] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [x] Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

@ArthurZucker @sgugger

peter-sk avatar Apr 27 '23 15:04 peter-sk

The documentation is not available anymore as the PR was closed or merged.

@ArthurZucker @sgugger @younesbelkada The next one is ready for review.

This is a bit funny. The tests are fine, and it runs great on one of my 4x V100 machines. But on another machine, I get this funny error:

/home/jps/anaconda3/envs/scandeval/lib/python3.9/site-packages/transformers/trainer.py:375 /home/jps/anaconda3/envs/scandeval/lib/python3.9/site-packages/torch/nn/modules/module.py:1269 AttributeError: 'GPT2ForQuestionAnswering' object has no attribute 'model_parallel'

Any ideas? I though model_parallel was legacy and not needed. Should I add to be on the safe side? torch version is torch==1.13.1.

peter-sk avatar Apr 28 '23 07:04 peter-sk

GPT2 is an old model so it might still be checking for model_parallel, which in this case has to be added! LMK if this fixes the issues

ArthurZucker avatar Apr 28 '23 09:04 ArthurZucker

@ArthurZucker ready for review!

peter-sk avatar Apr 29 '23 00:04 peter-sk

cc @younesbelkada since Arthur is on vacation.

sgugger avatar May 01 '23 13:05 sgugger