Add forward methods to quantizer that also computes commitment loss
# What does this PR do?

This PR adds the code to compute commitment loss for the quantizer. The loss is only computed in the newly added forward() methods.

This is a small part of the bigger #24295 


## 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](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case. #24295 
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] 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 

Much of this was adapted from https://github.com/facebookresearch/encodec/blob/main/encodec/quantization/core_vq.py

For reference, a part of the conversation is in one of the specific changes as well:
https://github.com/huggingface/transformers/commit/4f697be0b62c4f3b0401ccbd00d1d46aac81906d<|||||>@ArthurZucker 
Created a PR for this bit first, lemme know what you think. Thanks!<|||||>cc @sanchit-gandhi <|||||>Thanks for the review!

As I mentioned in https://github.com/huggingface/transformers/issues/24295#issuecomment-1614100206, I am busy in July so will be slow to iterate on this, but should have more time in August to keep iterating.<|||||>Awesome @hackyon! I believe the Meta AI authors are planning on releasing more fine-tuning code throughout July, so we'll be in a good position to finish this PR on your return 🤗<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_24593). All of your documentation changes will be reflected on that endpoint.