Incomplete model table
Author: LysandreJik
Pull request: no

The model table on the index of the documentation is incomplete it seems: https://huggingface.co/docs/transformers/index

Some models, like `MaskFormerSwin` or `Speech2Text2` show that there's no support in any library.

![swappy-20230904_161621](https://github.com/huggingface/transformers/assets/30755778/55116422-2d28-44ab-ad0e-214fc079d853)

cc @stevhliu 

Comments:
It looks like `TimmBackbone` also shows no support here. 

I suspect it may have something to do with the regex that matches the model names.  For example, `TimmBackbone` doesn't have a `Model`, `Encoder`, `Decoder`, or `ForConditionalGeneration` class. However, I'm not sure why it doesn't work for `MaskformerSwin` or `Speech2Text2` which have the `MaskFormerSwinModel` and `Speech2Text2Decoder` classes. 🤔 

https://github.com/huggingface/transformers/blob/09b2de6eb74b1e5ff4f4c3d9839485f4165627c9/utils/check_table.py#L89

cc @MKhalusova for additional help!

@stevhliu I'll look into it. 

@stevhliu, your suspicion was correct. When going through all of the transformer objects ( that we get with `dir(transformers_module)`), we match for names that have `Model`,`Encoder`, `Decoder`, or `ForConditionalGeneration` in it. 

For `TimmBackbone` the objects are: `['TimmBackbone', 'TimmBackboneConfig']`
For `MaskformerSwin` we get: `['MaskFormerSwinBackbone', 'MaskFormerSwinConfig']`
For `Speech2Text2` we get: `['Speech2Text2Config', 'Speech2Text2ForCausalLM', 'Speech2Text2PreTrainedModel', 'Speech2Text2Processor', 'Speech2Text2Tokenizer']`

So while the `MaskFormerSwinModel` and `Speech2Text2Decoder` classes exist they are not on the list that we get by calling `direct_transformers_import(TRANSFORMERS_PATH)`. They are not mentioned in the `__init__.py`. 

I am not sure how the `__init__.py` is constructed, but this is where the issue seems to be. 


Thanks for your help @MKhalusova!

Since the issue goes a bit deeper into how the `__init__.py` is constructed for these model classes, maybe @patrickvonplaten can provide some more guidance with `Speech2Text2` and @amyeroberts with `MaskformerSwin` and `TimmBackbone`?

For `MaskFormerSwin` and `TimmBackbone` this is because these models are backbones and so not meant to be loaded and used on their own. Instead, they define architectures which can be loaded using the `AutoBackbone` API. 

For `MaskFormerSwin`, there is a `MaskFormerSwinModel` class which we could have available in `dir(transformers_module)` by having it importable from the main init. 

For `TimmBackbone`, it's a bit trickier. This class enables us to load in timm weights as a backbone, and so acts as a wrapper around timm, but isn't a transformers model i.e. it's mapping in the pytorch/TF/JAX compatibility doesn't make sense because we can't pass e.g. `from_tf=True` to `TommBackbone.from_pretrained(checkpoint_name, from_tf=True)`. In this case we should probably remove it from being importable from the main init (this would need a deprecation cycle). 

Thanks for the explanations, @amyeroberts! I would say, that in this case, we should probably update the script that builds the model table in the docs to exclude `MaskFormerSwin` and `TimmBackbone`. Do you know if it's the same for `Speech2Text2`? 

@MKhalusova Sounds good! 

For Speech2Text2 I have no idea, unfortunately. Looking at the modeling code, there's no `Speech2Text2Model`. It looks like the structure is there to load the checkpoints in AutoEncoderDecoder, but not sure 🤷‍♀️  @patrickvonplaten will know :) 

> It looks like `TimmBackbone` also shows no support here.
> 
> I suspect it may have something to do with the regex that matches the model names. For example, `TimmBackbone` doesn't have a `Model`, `Encoder`, `Decoder`, or `ForConditionalGeneration` class. However, I'm not sure why it doesn't work for `MaskformerSwin` or `Speech2Text2` which have the `MaskFormerSwinModel` and `Speech2Text2Decoder` classes. 🤔
> 
> https://github.com/huggingface/transformers/blob/09b2de6eb74b1e5ff4f4c3d9839485f4165627c9/utils/check_table.py#L89
> 
> cc @MKhalusova for additional help!

what does this word do?
![image](https://github.com/huggingface/transformers/assets/67990935/268822c6-fc84-4cea-b6e1-91d1e9bda329)



I think we can close this issue. 

Yes, let's close it! Thanks all!