Prism model
Author: DaryaTereshchenko
Pull request: yes
Labels: name: New model

name: Text

# What does this PR do?
Add a new translation model, `Prism`, initially based on the [fairseq Transformer](https://github.com/facebookresearch/fairseq/tree/main/fairseq/models/transformer). 

The Prism model was first described in the paper [Automatic Machine Translation Evaluation in Many Languages via Zero-Shot Paraphrasing](https://aclanthology.org/2020.emnlp-main.8) (Thompson & Post, EMNLP 2020). Based on the code in this PR, I have converted the model to the HF model hub here: https://huggingface.co/dariast/prism

The original code can be found [here](https://github.com/thompsonb/prism/tree/master) and the original documentation is found [here](https://github.com/thompsonb/prism/blob/master/translation/README.md).

## Implementation notes
- The HF adaptation of the model is implemented utilizing existing [M2M100 model](https://github.com/huggingface/transformers/tree/main/src/transformers/models/m2m_100) architecture. The parts of the code that are identical to the HF M2M100 are cited accordingly. 
- The integration and performance tests are executed according to the guidelines and identical to the ones provided in the [M2M100 testing](https://github.com/huggingface/transformers/tree/main/tests/models/m2m_100) suite. 


## 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#create-a-pull-request), Pull Request section?
- [ ] 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.
- [x] 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).
- [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. 
Previously, the model's tests and  repository were reviewed by @jvamvas [here](https://github.com/jvamvas/transformers/pull/1).


Comments:
Hi @DaryaTereshchenko! Thanks for working on the model addition!

Since Prism is based on [M2M100](https://github.com/huggingface/transformers/tree/main/src/transformers/models/m2m_100), we should use `modular` transformers for the addition. `modular` allows using inheritance in transformers, I recommend checking https://huggingface.co/docs/transformers/en/modular_transformers as well as https://github.com/huggingface/transformers/blob/main/src/transformers/models/gemma2/modular_gemma2.py, https://github.com/huggingface/transformers/blob/main/src/transformers/models/glm/modular_glm.py . That will allow you to reuse components of M2M100, and write explicitly only what's new.

Hi @qubvel! Thank you for the resources and instructions. I will study them and make the necessary changes to the model.
Thank you for the help, and have a nice day!