File size: 49,108 Bytes
17c6d62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<!--Copyright 2020 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
-->

# πŸ€— Transformers

State-of-the-art Machine Learning for [PyTorch](https://pytorch.org/), [TensorFlow](https://www.tensorflow.org/), and [JAX](https://jax.readthedocs.io/en/latest/).

πŸ€— Transformers provides APIs and tools to easily download and train state-of-the-art pretrained models. Using pretrained models can reduce your compute costs, carbon footprint, and save you the time and resources required to train a model from scratch. These models support common tasks in different modalities, such as:

πŸ“ **Natural Language Processing**: text classification, named entity recognition, question answering, language modeling, code generation, summarization, translation, multiple choice, and text generation.<br>
πŸ–ΌοΈ **Computer Vision**: image classification, object detection, and segmentation.<br>
πŸ—£οΈ **Audio**: automatic speech recognition and audio classification.<br>
πŸ™ **Multimodal**: table question answering, optical character recognition, information extraction from scanned documents, video classification, and visual question answering.

πŸ€— Transformers support framework interoperability between PyTorch, TensorFlow, and JAX. This provides the flexibility to use a different framework at each stage of a model's life; train a model in three lines of code in one framework, and load it for inference in another. Models can also be exported to a format like ONNX and TorchScript for deployment in production environments.

Join the growing community on the [Hub](https://huggingface.co/models), [forum](https://discuss.huggingface.co/), or [Discord](https://discord.com/invite/JfAtkvEtRb) today!

## If you are looking for custom support from the Hugging Face team

<a target="_blank" href="https://huggingface.co/support">
    <img alt="HuggingFace Expert Acceleration Program" src="https://cdn-media.huggingface.co/marketing/transformers/new-support-improved.png" style="width: 100%; max-width: 600px; border: 1px solid #eee; border-radius: 4px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);">
</a>

## Contents

The documentation is organized into five sections:

- **GET STARTED** provides a quick tour of the library and installation instructions to get up and running.
- **TUTORIALS** are a great place to start if you're a beginner. This section will help you gain the basic skills you need to start using the library.
- **HOW-TO GUIDES** show you how to achieve a specific goal, like finetuning a pretrained model for language modeling or how to write and share a custom model.
- **CONCEPTUAL GUIDES** offers more discussion and explanation of the underlying concepts and ideas behind models, tasks, and the design philosophy of πŸ€— Transformers.
- **API** describes all classes and functions:

  - **MAIN CLASSES** details the most important classes like configuration, model, tokenizer, and pipeline.
  - **MODELS** details the classes and functions related to each model implemented in the library.
  - **INTERNAL HELPERS** details utility classes and functions used internally.


## Supported models and frameworks

The table below represents the current support in the library for each of those models, whether they have a Python
tokenizer (called "slow"). A "fast" tokenizer backed by the πŸ€— Tokenizers library, whether they have support in Jax (via
Flax), PyTorch, and/or TensorFlow.

<!--This table is updated automatically from the auto modules with _make fix-copies_. Do not update manually!-->

|                                  Model                                   | PyTorch support | TensorFlow support | Flax Support |
|:------------------------------------------------------------------------:|:---------------:|:------------------:|:------------:|
|                        [ALBERT](model_doc/albert)                        |       βœ…        |         βœ…         |      βœ…      |
|                         [ALIGN](model_doc/align)                         |       βœ…        |         ❌         |      ❌      |
|                       [AltCLIP](model_doc/altclip)                       |       βœ…        |         ❌         |      ❌      |
|                          [Aria](model_doc/aria)                          |       βœ…        |         ❌         |      ❌      |
|                     [AriaText](model_doc/aria_text)                      |       βœ…        |         ❌         |      ❌      |
| [Audio Spectrogram Transformer](model_doc/audio-spectrogram-transformer) |       βœ…        |         ❌         |      ❌      |
|                    [Autoformer](model_doc/autoformer)                    |       βœ…        |         ❌         |      ❌      |
|                         [Bamba](model_doc/bamba)                         |       βœ…        |         ❌         |      ❌      |
|                          [Bark](model_doc/bark)                          |       βœ…        |         ❌         |      ❌      |
|                          [BART](model_doc/bart)                          |       βœ…        |         βœ…         |      βœ…      |
|                       [BARThez](model_doc/barthez)                       |       βœ…        |         βœ…         |      βœ…      |
|                       [BARTpho](model_doc/bartpho)                       |       βœ…        |         βœ…         |      βœ…      |
|                          [BEiT](model_doc/beit)                          |       βœ…        |         ❌         |      βœ…      |
|                          [BERT](model_doc/bert)                          |       βœ…        |         βœ…         |      βœ…      |
|               [Bert Generation](model_doc/bert-generation)               |       βœ…        |         ❌         |      ❌      |
|                 [BertJapanese](model_doc/bert-japanese)                  |       βœ…        |         βœ…         |      βœ…      |
|                      [BERTweet](model_doc/bertweet)                      |       βœ…        |         βœ…         |      βœ…      |
|                      [BigBird](model_doc/big_bird)                       |       βœ…        |         ❌         |      βœ…      |
|               [BigBird-Pegasus](model_doc/bigbird_pegasus)               |       βœ…        |         ❌         |      ❌      |
|                        [BioGpt](model_doc/biogpt)                        |       βœ…        |         ❌         |      ❌      |
|                           [BiT](model_doc/bit)                           |       βœ…        |         ❌         |      ❌      |
|                    [Blenderbot](model_doc/blenderbot)                    |       βœ…        |         βœ…         |      βœ…      |
|              [BlenderbotSmall](model_doc/blenderbot-small)               |       βœ…        |         βœ…         |      βœ…      |
|                          [BLIP](model_doc/blip)                          |       βœ…        |         βœ…         |      ❌      |
|                        [BLIP-2](model_doc/blip-2)                        |       βœ…        |         ❌         |      ❌      |
|                         [BLOOM](model_doc/bloom)                         |       βœ…        |         ❌         |      βœ…      |
|                          [BORT](model_doc/bort)                          |       βœ…        |         βœ…         |      βœ…      |
|                   [BridgeTower](model_doc/bridgetower)                   |       βœ…        |         ❌         |      ❌      |
|                          [BROS](model_doc/bros)                          |       βœ…        |         ❌         |      ❌      |
|                          [ByT5](model_doc/byt5)                          |       βœ…        |         βœ…         |      βœ…      |
|                     [CamemBERT](model_doc/camembert)                     |       βœ…        |         βœ…         |      ❌      |
|                        [CANINE](model_doc/canine)                        |       βœ…        |         ❌         |      ❌      |
|                     [Chameleon](model_doc/chameleon)                     |       βœ…        |         ❌         |      ❌      |
|                  [Chinese-CLIP](model_doc/chinese_clip)                  |       βœ…        |         ❌         |      ❌      |
|                          [CLAP](model_doc/clap)                          |       βœ…        |         ❌         |      ❌      |
|                          [CLIP](model_doc/clip)                          |       βœ…        |         βœ…         |      βœ…      |
|                       [CLIPSeg](model_doc/clipseg)                       |       βœ…        |         ❌         |      ❌      |
|                          [CLVP](model_doc/clvp)                          |       βœ…        |         ❌         |      ❌      |
|                       [CodeGen](model_doc/codegen)                       |       βœ…        |         ❌         |      ❌      |
|                    [CodeLlama](model_doc/code_llama)                     |       βœ…        |         ❌         |      βœ…      |
|                        [Cohere](model_doc/cohere)                        |       βœ…        |         ❌         |      ❌      |
|                       [Cohere2](model_doc/cohere2)                       |       βœ…        |         ❌         |      ❌      |
|                       [ColPali](model_doc/colpali)                       |       βœ…        |         ❌         |      ❌      |
|              [Conditional DETR](model_doc/conditional_detr)              |       βœ…        |         ❌         |      ❌      |
|                      [ConvBERT](model_doc/convbert)                      |       βœ…        |         βœ…         |      ❌      |
|                      [ConvNeXT](model_doc/convnext)                      |       βœ…        |         βœ…         |      ❌      |
|                    [ConvNeXTV2](model_doc/convnextv2)                    |       βœ…        |         βœ…         |      ❌      |
|                           [CPM](model_doc/cpm)                           |       βœ…        |         βœ…         |      βœ…      |
|                       [CPM-Ant](model_doc/cpmant)                        |       βœ…        |         ❌         |      ❌      |
|                          [CTRL](model_doc/ctrl)                          |       βœ…        |         βœ…         |      ❌      |
|                           [CvT](model_doc/cvt)                           |       βœ…        |         βœ…         |      ❌      |
|                      [DAB-DETR](model_doc/dab-detr)                      |       βœ…        |         ❌         |      ❌      |
|                           [DAC](model_doc/dac)                           |       βœ…        |         ❌         |      ❌      |
|                   [Data2VecAudio](model_doc/data2vec)                    |       βœ…        |         ❌         |      ❌      |
|                    [Data2VecText](model_doc/data2vec)                    |       βœ…        |         ❌         |      ❌      |
|                   [Data2VecVision](model_doc/data2vec)                   |       βœ…        |         βœ…         |      ❌      |
|                          [DBRX](model_doc/dbrx)                          |       βœ…        |         ❌         |      ❌      |
|                       [DeBERTa](model_doc/deberta)                       |       βœ…        |         βœ…         |      ❌      |
|                    [DeBERTa-v2](model_doc/deberta-v2)                    |       βœ…        |         βœ…         |      ❌      |
|          [Decision Transformer](model_doc/decision_transformer)          |       βœ…        |         ❌         |      ❌      |
|               [Deformable DETR](model_doc/deformable_detr)               |       βœ…        |         ❌         |      ❌      |
|                          [DeiT](model_doc/deit)                          |       βœ…        |         βœ…         |      ❌      |
|                        [DePlot](model_doc/deplot)                        |       βœ…        |         ❌         |      ❌      |
|                [Depth Anything](model_doc/depth_anything)                |       βœ…        |         ❌         |      ❌      |
|                     [DepthPro](model_doc/depth_pro)                      |       βœ…        |         ❌         |      ❌      |
|                          [DETA](model_doc/deta)                          |       βœ…        |         ❌         |      ❌      |
|                          [DETR](model_doc/detr)                          |       βœ…        |         ❌         |      ❌      |
|                      [DialoGPT](model_doc/dialogpt)                      |       βœ…        |         βœ…         |      βœ…      |
|                     [DiffLlama](model_doc/diffllama)                     |       βœ…        |         ❌         |      ❌      |
|                         [DiNAT](model_doc/dinat)                         |       βœ…        |         ❌         |      ❌      |
|                        [DINOv2](model_doc/dinov2)                        |       βœ…        |         ❌         |      βœ…      |
|         [DINOv2 with Registers](model_doc/dinov2_with_registers)         |       βœ…        |         ❌         |      ❌      |
|                    [DistilBERT](model_doc/distilbert)                    |       βœ…        |         βœ…         |      βœ…      |
|                           [DiT](model_doc/dit)                           |       βœ…        |         ❌         |      βœ…      |
|                       [DonutSwin](model_doc/donut)                       |       βœ…        |         ❌         |      ❌      |
|                           [DPR](model_doc/dpr)                           |       βœ…        |         βœ…         |      ❌      |
|                           [DPT](model_doc/dpt)                           |       βœ…        |         ❌         |      ❌      |
|               [EfficientFormer](model_doc/efficientformer)               |       βœ…        |         βœ…         |      ❌      |
|                  [EfficientNet](model_doc/efficientnet)                  |       βœ…        |         ❌         |      ❌      |
|                       [ELECTRA](model_doc/electra)                       |       βœ…        |         βœ…         |      βœ…      |
|                          [Emu3](model_doc/emu3)                          |       βœ…        |         ❌         |      ❌      |
|                       [EnCodec](model_doc/encodec)                       |       βœ…        |         ❌         |      ❌      |
|               [Encoder decoder](model_doc/encoder-decoder)               |       βœ…        |         βœ…         |      βœ…      |
|                         [ERNIE](model_doc/ernie)                         |       βœ…        |         ❌         |      ❌      |
|                       [ErnieM](model_doc/ernie_m)                        |       βœ…        |         ❌         |      ❌      |
|                           [ESM](model_doc/esm)                           |       βœ…        |         βœ…         |      ❌      |
|              [FairSeq Machine-Translation](model_doc/fsmt)               |       βœ…        |         ❌         |      ❌      |
|                        [Falcon](model_doc/falcon)                        |       βœ…        |         ❌         |      ❌      |
|                       [Falcon3](model_doc/falcon3)                       |       βœ…        |         ❌         |      βœ…      |
|                  [FalconMamba](model_doc/falcon_mamba)                   |       βœ…        |         ❌         |      ❌      |
|         [FastSpeech2Conformer](model_doc/fastspeech2_conformer)          |       βœ…        |         ❌         |      ❌      |
|                       [FLAN-T5](model_doc/flan-t5)                       |       βœ…        |         βœ…         |      βœ…      |
|                      [FLAN-UL2](model_doc/flan-ul2)                      |       βœ…        |         βœ…         |      βœ…      |
|                      [FlauBERT](model_doc/flaubert)                      |       βœ…        |         βœ…         |      ❌      |
|                         [FLAVA](model_doc/flava)                         |       βœ…        |         ❌         |      ❌      |
|                          [FNet](model_doc/fnet)                          |       βœ…        |         ❌         |      ❌      |
|                      [FocalNet](model_doc/focalnet)                      |       βœ…        |         ❌         |      ❌      |
|                  [Funnel Transformer](model_doc/funnel)                  |       βœ…        |         βœ…         |      ❌      |
|                          [Fuyu](model_doc/fuyu)                          |       βœ…        |         ❌         |      ❌      |
|                         [Gemma](model_doc/gemma)                         |       βœ…        |         ❌         |      βœ…      |
|                        [Gemma2](model_doc/gemma2)                        |       βœ…        |         ❌         |      ❌      |
|                           [GIT](model_doc/git)                           |       βœ…        |         ❌         |      ❌      |
|                           [GLM](model_doc/glm)                           |       βœ…        |         ❌         |      ❌      |
|                          [GLPN](model_doc/glpn)                          |       βœ…        |         ❌         |      ❌      |
|                      [GOT-OCR2](model_doc/got_ocr2)                      |       βœ…        |         ❌         |      ❌      |
|                       [GPT Neo](model_doc/gpt_neo)                       |       βœ…        |         ❌         |      βœ…      |
|                      [GPT NeoX](model_doc/gpt_neox)                      |       βœ…        |         ❌         |      ❌      |
|             [GPT NeoX Japanese](model_doc/gpt_neox_japanese)             |       βœ…        |         ❌         |      ❌      |
|                         [GPT-J](model_doc/gptj)                          |       βœ…        |         βœ…         |      βœ…      |
|                       [GPT-Sw3](model_doc/gpt-sw3)                       |       βœ…        |         βœ…         |      βœ…      |
|                   [GPTBigCode](model_doc/gpt_bigcode)                    |       βœ…        |         ❌         |      ❌      |
|               [GPTSAN-japanese](model_doc/gptsan-japanese)               |       βœ…        |         ❌         |      ❌      |
|                       [Granite](model_doc/granite)                       |       βœ…        |         ❌         |      ❌      |
|                  [GraniteMoeMoe](model_doc/granitemoe)                   |       βœ…        |         ❌         |      ❌      |
|            [GraniteMoeSharedMoe](model_doc/granitemoeshared)             |       βœ…        |         ❌         |      ❌      |
|                    [Graphormer](model_doc/graphormer)                    |       βœ…        |         ❌         |      ❌      |
|                [Grounding DINO](model_doc/grounding-dino)                |       βœ…        |         ❌         |      ❌      |
|                      [GroupViT](model_doc/groupvit)                      |       βœ…        |         βœ…         |      ❌      |
|                        [Helium](model_doc/helium)                        |       βœ…        |         ❌         |      ❌      |
|                       [HerBERT](model_doc/herbert)                       |       βœ…        |         βœ…         |      βœ…      |
|                         [Hiera](model_doc/hiera)                         |       βœ…        |         ❌         |      ❌      |
|                        [Hubert](model_doc/hubert)                        |       βœ…        |         βœ…         |      ❌      |
|                        [I-BERT](model_doc/ibert)                         |       βœ…        |         ❌         |      ❌      |
|                        [I-JEPA](model_doc/ijepa)                         |       βœ…        |         ❌         |      ❌      |
|                       [IDEFICS](model_doc/idefics)                       |       βœ…        |         βœ…         |      ❌      |
|                      [Idefics2](model_doc/idefics2)                      |       βœ…        |         ❌         |      ❌      |
|                      [Idefics3](model_doc/idefics3)                      |       βœ…        |         ❌         |      ❌      |
|          [Idefics3VisionTransformer](model_doc/idefics3_vision)          |       ❌        |         ❌         |      ❌      |
|                      [ImageGPT](model_doc/imagegpt)                      |       βœ…        |         ❌         |      ❌      |
|                      [Informer](model_doc/informer)                      |       βœ…        |         ❌         |      ❌      |
|                  [InstructBLIP](model_doc/instructblip)                  |       βœ…        |         ❌         |      ❌      |
|             [InstructBlipVideo](model_doc/instructblipvideo)             |       βœ…        |         ❌         |      ❌      |
|                         [Jamba](model_doc/jamba)                         |       βœ…        |         ❌         |      ❌      |
|                        [JetMoe](model_doc/jetmoe)                        |       βœ…        |         ❌         |      ❌      |
|                       [Jukebox](model_doc/jukebox)                       |       βœ…        |         ❌         |      ❌      |
|                      [KOSMOS-2](model_doc/kosmos-2)                      |       βœ…        |         ❌         |      ❌      |
|                      [LayoutLM](model_doc/layoutlm)                      |       βœ…        |         βœ…         |      ❌      |
|                    [LayoutLMv2](model_doc/layoutlmv2)                    |       βœ…        |         ❌         |      ❌      |
|                    [LayoutLMv3](model_doc/layoutlmv3)                    |       βœ…        |         βœ…         |      ❌      |
|                     [LayoutXLM](model_doc/layoutxlm)                     |       βœ…        |         ❌         |      ❌      |
|                           [LED](model_doc/led)                           |       βœ…        |         βœ…         |      ❌      |
|                         [LeViT](model_doc/levit)                         |       βœ…        |         ❌         |      ❌      |
|                          [LiLT](model_doc/lilt)                          |       βœ…        |         ❌         |      ❌      |
|                         [LLaMA](model_doc/llama)                         |       βœ…        |         ❌         |      βœ…      |
|                        [Llama2](model_doc/llama2)                        |       βœ…        |         ❌         |      βœ…      |
|                        [Llama3](model_doc/llama3)                        |       βœ…        |         ❌         |      βœ…      |
|                         [LLaVa](model_doc/llava)                         |       βœ…        |         ❌         |      ❌      |
|                    [LLaVA-NeXT](model_doc/llava_next)                    |       βœ…        |         ❌         |      ❌      |
|              [LLaVa-NeXT-Video](model_doc/llava_next_video)              |       βœ…        |         ❌         |      ❌      |
|               [LLaVA-Onevision](model_doc/llava_onevision)               |       βœ…        |         ❌         |      ❌      |
|                    [Longformer](model_doc/longformer)                    |       βœ…        |         βœ…         |      ❌      |
|                        [LongT5](model_doc/longt5)                        |       βœ…        |         ❌         |      βœ…      |
|                          [LUKE](model_doc/luke)                          |       βœ…        |         ❌         |      ❌      |
|                        [LXMERT](model_doc/lxmert)                        |       βœ…        |         βœ…         |      ❌      |
|                        [M-CTC-T](model_doc/mctct)                        |       βœ…        |         ❌         |      ❌      |
|                       [M2M100](model_doc/m2m_100)                        |       βœ…        |         ❌         |      ❌      |
|                    [MADLAD-400](model_doc/madlad-400)                    |       βœ…        |         βœ…         |      βœ…      |
|                         [Mamba](model_doc/mamba)                         |       βœ…        |         ❌         |      ❌      |
|                        [mamba2](model_doc/mamba2)                        |       βœ…        |         ❌         |      ❌      |
|                        [Marian](model_doc/marian)                        |       βœ…        |         βœ…         |      βœ…      |
|                      [MarkupLM](model_doc/markuplm)                      |       βœ…        |         ❌         |      ❌      |
|                   [Mask2Former](model_doc/mask2former)                   |       βœ…        |         ❌         |      ❌      |
|                    [MaskFormer](model_doc/maskformer)                    |       βœ…        |         ❌         |      ❌      |
|                        [MatCha](model_doc/matcha)                        |       βœ…        |         ❌         |      ❌      |
|                         [mBART](model_doc/mbart)                         |       βœ…        |         βœ…         |      βœ…      |
|                      [mBART-50](model_doc/mbart50)                       |       βœ…        |         βœ…         |      βœ…      |
|                          [MEGA](model_doc/mega)                          |       βœ…        |         ❌         |      ❌      |
|                 [Megatron-BERT](model_doc/megatron-bert)                 |       βœ…        |         ❌         |      ❌      |
|                 [Megatron-GPT2](model_doc/megatron_gpt2)                 |       βœ…        |         βœ…         |      βœ…      |
|                       [MGP-STR](model_doc/mgp-str)                       |       βœ…        |         ❌         |      ❌      |
|                          [Mimi](model_doc/mimi)                          |       βœ…        |         ❌         |      ❌      |
|                       [Mistral](model_doc/mistral)                       |       βœ…        |         βœ…         |      βœ…      |
|                       [Mixtral](model_doc/mixtral)                       |       βœ…        |         ❌         |      ❌      |
|                        [Mllama](model_doc/mllama)                        |       βœ…        |         ❌         |      ❌      |
|                         [mLUKE](model_doc/mluke)                         |       βœ…        |         ❌         |      ❌      |
|                           [MMS](model_doc/mms)                           |       βœ…        |         βœ…         |      βœ…      |
|                    [MobileBERT](model_doc/mobilebert)                    |       βœ…        |         βœ…         |      ❌      |
|                  [MobileNetV1](model_doc/mobilenet_v1)                   |       βœ…        |         ❌         |      ❌      |
|                  [MobileNetV2](model_doc/mobilenet_v2)                   |       βœ…        |         ❌         |      ❌      |
|                     [MobileViT](model_doc/mobilevit)                     |       βœ…        |         βœ…         |      ❌      |
|                   [MobileViTV2](model_doc/mobilevitv2)                   |       βœ…        |         ❌         |      ❌      |
|                    [ModernBERT](model_doc/modernbert)                    |       βœ…        |         ❌         |      ❌      |
|                     [Moonshine](model_doc/moonshine)                     |       βœ…        |         ❌         |      ❌      |
|                         [Moshi](model_doc/moshi)                         |       βœ…        |         ❌         |      ❌      |
|                         [MPNet](model_doc/mpnet)                         |       βœ…        |         βœ…         |      ❌      |
|                           [MPT](model_doc/mpt)                           |       βœ…        |         ❌         |      ❌      |
|                           [MRA](model_doc/mra)                           |       βœ…        |         ❌         |      ❌      |
|                           [MT5](model_doc/mt5)                           |       βœ…        |         βœ…         |      βœ…      |
|                      [MusicGen](model_doc/musicgen)                      |       βœ…        |         ❌         |      ❌      |
|               [MusicGen Melody](model_doc/musicgen_melody)               |       βœ…        |         ❌         |      ❌      |
|                           [MVP](model_doc/mvp)                           |       βœ…        |         ❌         |      ❌      |
|                           [NAT](model_doc/nat)                           |       βœ…        |         ❌         |      ❌      |
|                      [Nemotron](model_doc/nemotron)                      |       βœ…        |         ❌         |      ❌      |
|                         [Nezha](model_doc/nezha)                         |       βœ…        |         ❌         |      ❌      |
|                          [NLLB](model_doc/nllb)                          |       βœ…        |         ❌         |      ❌      |
|                      [NLLB-MOE](model_doc/nllb-moe)                      |       βœ…        |         ❌         |      ❌      |
|                        [Nougat](model_doc/nougat)                        |       βœ…        |         βœ…         |      βœ…      |
|                 [NystrΓΆmformer](model_doc/nystromformer)                 |       βœ…        |         ❌         |      ❌      |
|                          [OLMo](model_doc/olmo)                          |       βœ…        |         ❌         |      ❌      |
|                         [OLMo2](model_doc/olmo2)                         |       βœ…        |         ❌         |      ❌      |
|                         [OLMoE](model_doc/olmoe)                         |       βœ…        |         ❌         |      ❌      |
|                   [OmDet-Turbo](model_doc/omdet-turbo)                   |       βœ…        |         ❌         |      ❌      |
|                     [OneFormer](model_doc/oneformer)                     |       βœ…        |         ❌         |      ❌      |
|                    [OpenAI GPT](model_doc/openai-gpt)                    |       βœ…        |         βœ…         |      ❌      |
|                      [OpenAI GPT-2](model_doc/gpt2)                      |       βœ…        |         βœ…         |      βœ…      |
|                    [OpenLlama](model_doc/open-llama)                     |       βœ…        |         ❌         |      ❌      |
|                           [OPT](model_doc/opt)                           |       βœ…        |         βœ…         |      βœ…      |
|                       [OWL-ViT](model_doc/owlvit)                        |       βœ…        |         ❌         |      ❌      |
|                         [OWLv2](model_doc/owlv2)                         |       βœ…        |         ❌         |      ❌      |
|                     [PaliGemma](model_doc/paligemma)                     |       βœ…        |         ❌         |      ❌      |
|                  [PatchTSMixer](model_doc/patchtsmixer)                  |       βœ…        |         ❌         |      ❌      |
|                      [PatchTST](model_doc/patchtst)                      |       βœ…        |         ❌         |      ❌      |
|                       [Pegasus](model_doc/pegasus)                       |       βœ…        |         βœ…         |      βœ…      |
|                     [PEGASUS-X](model_doc/pegasus_x)                     |       βœ…        |         ❌         |      ❌      |
|                     [Perceiver](model_doc/perceiver)                     |       βœ…        |         ❌         |      ❌      |
|                     [Persimmon](model_doc/persimmon)                     |       βœ…        |         ❌         |      ❌      |
|                           [Phi](model_doc/phi)                           |       βœ…        |         ❌         |      ❌      |
|                          [Phi3](model_doc/phi3)                          |       βœ…        |         ❌         |      ❌      |
|                        [Phimoe](model_doc/phimoe)                        |       βœ…        |         ❌         |      ❌      |
|                       [PhoBERT](model_doc/phobert)                       |       βœ…        |         βœ…         |      βœ…      |
|                    [Pix2Struct](model_doc/pix2struct)                    |       βœ…        |         ❌         |      ❌      |
|                       [Pixtral](model_doc/pixtral)                       |       βœ…        |         ❌         |      ❌      |
|                        [PLBart](model_doc/plbart)                        |       βœ…        |         ❌         |      ❌      |
|                    [PoolFormer](model_doc/poolformer)                    |       βœ…        |         ❌         |      ❌      |
|                     [Pop2Piano](model_doc/pop2piano)                     |       βœ…        |         ❌         |      ❌      |
|                    [ProphetNet](model_doc/prophetnet)                    |       βœ…        |         ❌         |      ❌      |
|                           [PVT](model_doc/pvt)                           |       βœ…        |         ❌         |      ❌      |
|                        [PVTv2](model_doc/pvt_v2)                         |       βœ…        |         ❌         |      ❌      |
|                       [QDQBert](model_doc/qdqbert)                       |       βœ…        |         ❌         |      ❌      |
|                         [Qwen2](model_doc/qwen2)                         |       βœ…        |         ❌         |      ❌      |
|                    [Qwen2_5_VL](model_doc/qwen2_5_vl)                    |       βœ…        |         ❌         |      ❌      |
|                   [Qwen2Audio](model_doc/qwen2_audio)                    |       βœ…        |         ❌         |      ❌      |
|                     [Qwen2MoE](model_doc/qwen2_moe)                      |       βœ…        |         ❌         |      ❌      |
|                      [Qwen2VL](model_doc/qwen2_vl)                       |       βœ…        |         ❌         |      ❌      |
|                           [RAG](model_doc/rag)                           |       βœ…        |         βœ…         |      ❌      |
|                         [REALM](model_doc/realm)                         |       βœ…        |         ❌         |      ❌      |
|               [RecurrentGemma](model_doc/recurrent_gemma)                |       βœ…        |         ❌         |      ❌      |
|                      [Reformer](model_doc/reformer)                      |       βœ…        |         ❌         |      ❌      |
|                        [RegNet](model_doc/regnet)                        |       βœ…        |         βœ…         |      βœ…      |
|                       [RemBERT](model_doc/rembert)                       |       βœ…        |         βœ…         |      ❌      |
|                        [ResNet](model_doc/resnet)                        |       βœ…        |         βœ…         |      βœ…      |
|                     [RetriBERT](model_doc/retribert)                     |       βœ…        |         ❌         |      ❌      |
|                       [RoBERTa](model_doc/roberta)                       |       βœ…        |         βœ…         |      βœ…      |
|          [RoBERTa-PreLayerNorm](model_doc/roberta-prelayernorm)          |       βœ…        |         βœ…         |      βœ…      |
|                      [RoCBert](model_doc/roc_bert)                       |       βœ…        |         ❌         |      ❌      |
|                      [RoFormer](model_doc/roformer)                      |       βœ…        |         βœ…         |      βœ…      |
|                       [RT-DETR](model_doc/rt_detr)                       |       βœ…        |         ❌         |      ❌      |
|                [RT-DETR-ResNet](model_doc/rt_detr_resnet)                |       βœ…        |         ❌         |      ❌      |
|                    [RT-DETRv2](model_doc/rt_detr_v2)                     |       βœ…        |         ❌         |      ❌      |
|                          [RWKV](model_doc/rwkv)                          |       βœ…        |         ❌         |      ❌      |
|                           [SAM](model_doc/sam)                           |       βœ…        |         βœ…         |      ❌      |
|                  [SeamlessM4T](model_doc/seamless_m4t)                   |       βœ…        |         ❌         |      ❌      |
|                [SeamlessM4Tv2](model_doc/seamless_m4t_v2)                |       βœ…        |         ❌         |      ❌      |
|                     [SegFormer](model_doc/segformer)                     |       βœ…        |         βœ…         |      ❌      |
|                        [SegGPT](model_doc/seggpt)                        |       βœ…        |         ❌         |      ❌      |
|                           [SEW](model_doc/sew)                           |       βœ…        |         ❌         |      ❌      |
|                         [SEW-D](model_doc/sew-d)                         |       βœ…        |         ❌         |      ❌      |
|                        [SigLIP](model_doc/siglip)                        |       βœ…        |         ❌         |      ❌      |
|        [Speech Encoder decoder](model_doc/speech-encoder-decoder)        |       βœ…        |         ❌         |      βœ…      |
|                 [Speech2Text](model_doc/speech_to_text)                  |       βœ…        |         βœ…         |      ❌      |
|                      [SpeechT5](model_doc/speecht5)                      |       βœ…        |         ❌         |      ❌      |
|                      [Splinter](model_doc/splinter)                      |       βœ…        |         ❌         |      ❌      |
|                   [SqueezeBERT](model_doc/squeezebert)                   |       βœ…        |         ❌         |      ❌      |
|                      [StableLm](model_doc/stablelm)                      |       βœ…        |         ❌         |      ❌      |
|                    [Starcoder2](model_doc/starcoder2)                    |       βœ…        |         ❌         |      ❌      |
|                     [SuperGlue](model_doc/superglue)                     |       βœ…        |         ❌         |      ❌      |
|                    [SuperPoint](model_doc/superpoint)                    |       βœ…        |         ❌         |      ❌      |
|                   [SwiftFormer](model_doc/swiftformer)                   |       βœ…        |         βœ…         |      ❌      |
|                    [Swin Transformer](model_doc/swin)                    |       βœ…        |         βœ…         |      ❌      |
|                 [Swin Transformer V2](model_doc/swinv2)                  |       βœ…        |         ❌         |      ❌      |
|                       [Swin2SR](model_doc/swin2sr)                       |       βœ…        |         ❌         |      ❌      |
|           [SwitchTransformers](model_doc/switch_transformers)            |       βœ…        |         ❌         |      ❌      |
|                            [T5](model_doc/t5)                            |       βœ…        |         βœ…         |      βœ…      |
|                        [T5v1.1](model_doc/t5v1.1)                        |       βœ…        |         βœ…         |      βœ…      |
|             [Table Transformer](model_doc/table-transformer)             |       βœ…        |         ❌         |      ❌      |
|                         [TAPAS](model_doc/tapas)                         |       βœ…        |         βœ…         |      ❌      |
|                         [TAPEX](model_doc/tapex)                         |       βœ…        |         βœ…         |      βœ…      |
|                       [TextNet](model_doc/textnet)                       |       βœ…        |         ❌         |      ❌      |
|       [Time Series Transformer](model_doc/time_series_transformer)       |       βœ…        |         ❌         |      ❌      |
|                   [TimeSformer](model_doc/timesformer)                   |       βœ…        |         ❌         |      ❌      |
|                [TimmWrapperModel](model_doc/timm_wrapper)                |       βœ…        |         ❌         |      ❌      |
|        [Trajectory Transformer](model_doc/trajectory_transformer)        |       βœ…        |         ❌         |      ❌      |
|                  [Transformer-XL](model_doc/transfo-xl)                  |       βœ…        |         βœ…         |      ❌      |
|                         [TrOCR](model_doc/trocr)                         |       βœ…        |         ❌         |      ❌      |
|                          [TVLT](model_doc/tvlt)                          |       βœ…        |         ❌         |      ❌      |
|                           [TVP](model_doc/tvp)                           |       βœ…        |         ❌         |      ❌      |
|                          [UDOP](model_doc/udop)                          |       βœ…        |         ❌         |      ❌      |
|                           [UL2](model_doc/ul2)                           |       βœ…        |         βœ…         |      βœ…      |
|                          [UMT5](model_doc/umt5)                          |       βœ…        |         ❌         |      ❌      |
|                     [UniSpeech](model_doc/unispeech)                     |       βœ…        |         ❌         |      ❌      |
|                 [UniSpeechSat](model_doc/unispeech-sat)                  |       βœ…        |         ❌         |      ❌      |
|                       [UnivNet](model_doc/univnet)                       |       βœ…        |         ❌         |      ❌      |
|                       [UPerNet](model_doc/upernet)                       |       βœ…        |         ❌         |      ❌      |
|                           [VAN](model_doc/van)                           |       βœ…        |         ❌         |      ❌      |
|                   [VideoLlava](model_doc/video_llava)                    |       βœ…        |         ❌         |      ❌      |
|                      [VideoMAE](model_doc/videomae)                      |       βœ…        |         ❌         |      ❌      |
|                          [ViLT](model_doc/vilt)                          |       βœ…        |         ❌         |      ❌      |
|                      [VipLlava](model_doc/vipllava)                      |       βœ…        |         ❌         |      ❌      |
|        [Vision Encoder decoder](model_doc/vision-encoder-decoder)        |       βœ…        |         βœ…         |      βœ…      |
|       [VisionTextDualEncoder](model_doc/vision-text-dual-encoder)        |       βœ…        |         βœ…         |      βœ…      |
|                   [VisualBERT](model_doc/visual_bert)                    |       βœ…        |         ❌         |      ❌      |
|                           [ViT](model_doc/vit)                           |       βœ…        |         βœ…         |      βœ…      |
|                    [ViT Hybrid](model_doc/vit_hybrid)                    |       βœ…        |         ❌         |      ❌      |
|                        [VitDet](model_doc/vitdet)                        |       βœ…        |         ❌         |      ❌      |
|                       [ViTMAE](model_doc/vit_mae)                        |       βœ…        |         βœ…         |      ❌      |
|                      [ViTMatte](model_doc/vitmatte)                      |       βœ…        |         ❌         |      ❌      |
|                       [ViTMSN](model_doc/vit_msn)                        |       βœ…        |         ❌         |      ❌      |
|                       [ViTPose](model_doc/vitpose)                       |       βœ…        |         ❌         |      ❌      |
|              [ViTPoseBackbone](model_doc/vitpose_backbone)               |       βœ…        |         ❌         |      ❌      |
|                          [VITS](model_doc/vits)                          |       βœ…        |         ❌         |      ❌      |
|                         [ViViT](model_doc/vivit)                         |       βœ…        |         ❌         |      ❌      |
|                      [Wav2Vec2](model_doc/wav2vec2)                      |       βœ…        |         βœ…         |      βœ…      |
|                 [Wav2Vec2-BERT](model_doc/wav2vec2-bert)                 |       βœ…        |         ❌         |      ❌      |
|            [Wav2Vec2-Conformer](model_doc/wav2vec2-conformer)            |       βœ…        |         ❌         |      ❌      |
|              [Wav2Vec2Phoneme](model_doc/wav2vec2_phoneme)               |       βœ…        |         βœ…         |      βœ…      |
|                         [WavLM](model_doc/wavlm)                         |       βœ…        |         ❌         |      ❌      |
|                       [Whisper](model_doc/whisper)                       |       βœ…        |         βœ…         |      βœ…      |
|                        [X-CLIP](model_doc/xclip)                         |       βœ…        |         ❌         |      ❌      |
|                         [X-MOD](model_doc/xmod)                          |       βœ…        |         ❌         |      ❌      |
|                          [XGLM](model_doc/xglm)                          |       βœ…        |         βœ…         |      βœ…      |
|                           [XLM](model_doc/xlm)                           |       βœ…        |         βœ…         |      ❌      |
|                [XLM-ProphetNet](model_doc/xlm-prophetnet)                |       βœ…        |         ❌         |      ❌      |
|                   [XLM-RoBERTa](model_doc/xlm-roberta)                   |       βœ…        |         βœ…         |      βœ…      |
|                [XLM-RoBERTa-XL](model_doc/xlm-roberta-xl)                |       βœ…        |         ❌         |      ❌      |
|                         [XLM-V](model_doc/xlm-v)                         |       βœ…        |         βœ…         |      βœ…      |
|                         [XLNet](model_doc/xlnet)                         |       βœ…        |         βœ…         |      ❌      |
|                         [XLS-R](model_doc/xls_r)                         |       βœ…        |         βœ…         |      βœ…      |
|                 [XLSR-Wav2Vec2](model_doc/xlsr_wav2vec2)                 |       βœ…        |         βœ…         |      βœ…      |
|                         [YOLOS](model_doc/yolos)                         |       βœ…        |         ❌         |      ❌      |
|                          [YOSO](model_doc/yoso)                          |       βœ…        |         ❌         |      ❌      |
|                         [Zamba](model_doc/zamba)                         |       βœ…        |         ❌         |      ❌      |
|                        [Zamba2](model_doc/zamba2)                        |       βœ…        |         ❌         |      ❌      |
|                      [ZoeDepth](model_doc/zoedepth)                      |       βœ…        |         ❌         |      ❌      |

<!-- End table-->