

TITLE
[docs] fix xref to `PreTrainedModel.generate`

COMMENTS
5

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
This PR partially resolves the issue raised in https://github.com/huggingface/transformers/issues/9202

I spent quite some time to try to figure out how to get sphinx to figure out the inheritance so that it could cross-reference inherited methods, but it can't even handle mixins it seems. i.e. it can't resolve: `transformers.PreTrainedModel.generate` 

So one has to explicitly specify the fully qualified original method for xref to work :(

Bottom line - if currently you want a cross-reference link to `transformers.PreTrainedModel.generate` or `T5ForConditionalGeneration.generate` to work, you have to use `~transformers.generation_utils.GenerationMixin.generate`

So I did:
```
find . -type d -name ".git" -prune -o -type f -exec perl -pi -e 's|transformers\.\w+\.generate|transformers.generation_utils.GenerationMixin.generate|g' {} \;
```

then also added the same for `transformers.PreTrainedModel.(greedy_search|sample|beam_search|beam_sample|group_beam_search)`
```
find . -type d -name ".git" -prune -o -type f -exec perl -pi -e 's#transformers.PreTrainedModel.(greedy_search|sample|beam_search|beam_sample|group_beam_search)#transformers.generation_utils.GenerationMixin.$1#g' {} \;
```

Fixes: https://github.com/huggingface/transformers/issues/9202

@sgugger 