modular_model_converter bugfix on assignments
Author: nikosanto13
Pull request: yes

# What does this PR do?

This PR improves the logic of modular_model_converter.py script in order to keep the assignments from modular files.


## Before submitting
- [x] 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.
- [ ] 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?

@ArthurZucker, @Cyrilvallez


## Additional details

Besides the changes on utils/modular_model_converter.py script:
* Regenerated `modeling_*.py` files which resolved some bugs that affected docstrings, e.g IJEPA's `_IMAGE_CLASS` checkpoint and `EXPECTED_OUTPUT` and phi's checkpoint (which was inherited from Mistral, since the corresponding modular file was lacking a checkpoint definition)
* Had to copy-paste the mistral docstring in the modular_starcoder2.py. Apparently, this is needed because the forward pass of modular-defined `Starcoder2Model` is decorated with `STARCODER2_INPUTS_DOCSTRING`. Copy-pasting is somewhat a contradiction to the "modular" logic, but if I'm not mistaken there wasn't an easier solution.


Comments:
Hey! Thanks for the contribution! However, the merging rule for assignment was specifically chosen to avoid having to redefine the big docstrings (what you did with Starcoder2) or very common variables while we think of a better solution for automatic docstrings.
However, using regex patterns instead of hard matching for `ASSIGNMENTS_TO_KEEP` may be a good idea, as I think it's not always exactly `"_CHECKPOINT_FOR_DOC"` for older models.
Is there a specific reason why you need this change BTW? 🤗

@Cyrilvallez hey, thanks for the update. Well I observed the erroneous documentation with phi and jepa modular files and I figured this should be fixed this with the regex patterns (also to avoid any potential issues in the future). The fix had the byproduct of having to redefine the docstring (since the docstring variable name now matches the regex pattern).

I guess if the errors in documentations are less of an issue, then it could be skipped.

I see! Super cool initiative! Let's do it then!

@Cyrilvallez thanks for ur help. I didn't like my change for the docstring either (neither I knew about future plans on automatic docstrings), glad to get feedback there.

@ArthurZucker I'm frequently using the modeling files of speech ssl models (wav2vec2, hubert, wavlm etc.) and I see that they don't have modular files yet (but have large duplication). Would you welcome a PR on that?

Yeah for sure! 🤗 

If needed you can get more details about modular with https://github.com/huggingface/transformers/pull/35737 (I rewrote the doc recently) 🤗 

awesome, I'll definitely use it