There is a type annotation error
### System Info

Transformer 4.22.0
Ubuntu 20.04
Python 3.10.6

### Who can help?

@sgugger, @patil-suraj

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

The type annotation bug is [here](https://github.com/huggingface/transformers/blob/main/examples/research_projects/rag/finetune_rag.py#:~:text=model%3A%20GenerativeQAModule%20%3D%20GenerativeQAModule(args))
Trying to annotate `model` as type  `GenerativeQAModule` at line 586 violates the rules of type annotation, 
because `model` had been firstly initialized as `None` or other value at line 536. 


```
#transformers/examples/research_projects/rag/finetune_rag.py #Line 536

def main(args=None, model=None) -> GenerativeQAModule:
     ...
    if model is None:
        model: GenerativeQAModule = GenerativeQAModule(args)
```


I found this defect by using the tool called [Pyre](https://pyre-check.org/docs/getting-started/).
`pyre init`
`pyre`

### Expected behavior

I expected no defect reported


Thanks for reporting. Note that we do not maintain the examples lying in the research project folder, and we only use type annotations for documentation purpose, not for type-checkers.<|||||>@sgugger Will you have any comming project related to vision transformer that I can contribute to. <|||||>Can i get this issue?<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.