File size: 1,519 Bytes
75466df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
AutoModels
-----------

In many cases, the architecture you want to use can be guessed from the name or the path of the pretrained model you are supplying to the ``from_pretrained`` method.

AutoClasses are here to do this job for you so that you automatically retrieve the relevant model given the name/path to the pretrained weights/config/vocabulary:

Instantiating one of ``AutoModel``, ``AutoConfig`` and ``AutoTokenizer`` will directly create a class of the relevant architecture (ex: ``model = AutoModel.from_pretrained('bert-base-cased')`` will create a instance of ``BertModel``).


``AutoConfig``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoConfig
    :members:


``AutoTokenizer``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoTokenizer
    :members:


``AutoModel``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoModel
    :members:


``AutoModelForPreTraining``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoModelForPreTraining
    :members:


``AutoModelWithLMHead``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoModelWithLMHead
    :members:


``AutoModelForSequenceClassification``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoModelForSequenceClassification
    :members:


``AutoModelForQuestionAnswering``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoModelForQuestionAnswering
    :members:


``AutoModelForTokenClassification``
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.AutoModelForTokenClassification
    :members: