Update modeling_opt.py
# What does this PR do?

As suggested in the [#22561 ](https://github.com/huggingface/transformers/issues/22561) ,moved labels to the same device as logits for OTP , codegen  and gptj

@sgugger  can u pls review this once??
_The documentation is not available anymore as the PR was closed or merged._<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_22868). All of your documentation changes will be reflected on that endpoint.