Added @property into the modeliing_encoder_decoder file. 
Author: hisushanta
Pull request: yes

I made the "encoder" and "decoder" properties easier to use by making them "read-only". This means you can see their values, but not change them directly.

Additionally, I created a special way to change the "output embeddings" of the decoder. You can use this by assigning a new value to the "output_embeddings" property.

## 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#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.
- [] 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?
@amyeroberts , @ArthurZucker 

Comments:
Hi @hi-sushanta, thanks for opening a PR! 

Why make these changes? 

Hello, @amyeroberts.

Here are the reasons why I made the changes described in the code review comment:

***1. Improved user-friendliness:***

Making the "encoder" and "decoder" properties read-only prevents accidental modifications and simplifies the API for users. This makes it easier to understand and use the code, especially for beginners.
Creating a dedicated method for changing the "output embeddings" provides a controlled and documented way to modify this important parameter. This helps ensure consistency and avoid potential issues.

***2. Enhanced maintainability:***

Read-only properties make the code more robust and less prone to errors. By separating the access and modification functionality, the code becomes easier to maintain and understand.
The dedicated "output_embeddings" setter allows for cleaner and more concise code, as it avoids inline logic for handling the update. This improves code readability and maintainability.

***3. Additional benefits:***

Read-only properties can improve performance by avoiding unnecessary calculations and memory allocations.
Having a dedicated setter for "output embeddings" enables future enhancements, such as adding validations or logging changes.


@hi-sushanta Thank you for taking the time to do this. 

However, adding the `_encoder` and `_decoder` attributes is not something we're going to merge in. It goes against the pattern of other model implementations in the code base, potentially breaks things as users still expect to be able to use `model.encoder`, generally makes things harder to read and we're yet to have any complaints from users about `model.encoder` being hard to use. 

If you wish to enable a setter for the output embeddings, you can add this following the pattern for other models e.g. [here for llava](https://github.com/huggingface/transformers/blob/ec43d6870aa1afb42a6d2b1b0a03743d3f9b3ce6/src/transformers/models/llava/modeling_llava.py#L250C1-L250C1).

I understand your concerns regarding the _encoder and _decoder attributes. I agree that maintaining consistency with the existing pattern is important. I'm happy to revert this change and ensure my contribution aligns with the code base standards.