This commit is contained in:
Lysandre
2020-06-01 12:57:40 -04:00
parent ec8717d5d8
commit 6449c494d0
2 changed files with 71 additions and 0 deletions

View File

@@ -328,6 +328,11 @@ class AutoModel:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
@@ -480,6 +485,11 @@ class AutoModelForPreTraining:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
@@ -625,6 +635,11 @@ class AutoModelWithLMHead:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
@@ -771,6 +786,11 @@ class AutoModelForSequenceClassification:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
@@ -918,6 +938,11 @@ class AutoModelForQuestionAnswering:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
@@ -1058,6 +1083,11 @@ class AutoModelForTokenClassification:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:

View File

@@ -238,6 +238,12 @@ class TFAutoModel(object):
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args:
config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`:
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
- isInstance of `distilbert` configuration class: TFDistilBertModel (DistilBERT model) - isInstance of `distilbert` configuration class: TFDistilBertModel (DistilBERT model)
@@ -378,6 +384,11 @@ class TFAutoModelForPreTraining(object):
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args: Args:
config (:class:`~transformers.PretrainedConfig`): config (:class:`~transformers.PretrainedConfig`):
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
@@ -544,6 +555,12 @@ class TFAutoModelWithLMHead(object):
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args:
config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`:
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
- isInstance of `distilbert` configuration class: DistilBertModel (DistilBERT model) - isInstance of `distilbert` configuration class: DistilBertModel (DistilBERT model)
@@ -699,6 +716,12 @@ class TFAutoModelForMultipleChoice:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args:
config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`:
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
- isInstance of `albert` configuration class: AlbertModel (Albert model) - isInstance of `albert` configuration class: AlbertModel (Albert model)
@@ -849,6 +872,12 @@ class TFAutoModelForSequenceClassification(object):
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args:
config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`:
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
- isInstance of `distilbert` configuration class: DistilBertModel (DistilBERT model) - isInstance of `distilbert` configuration class: DistilBertModel (DistilBERT model)
@@ -1006,6 +1035,12 @@ class TFAutoModelForQuestionAnswering(object):
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args:
config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`:
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
- isInstance of `distilbert` configuration class: DistilBertModel (DistilBERT model) - isInstance of `distilbert` configuration class: DistilBertModel (DistilBERT model)
@@ -1143,6 +1178,12 @@ class TFAutoModelForTokenClassification:
r""" Instantiates one of the base model classes of the library r""" Instantiates one of the base model classes of the library
from a configuration. from a configuration.
Note:
Loading a model from its configuration file does **not** load the model weights.
It only affects the model's configuration. Use :func:`~transformers.AutoModel.from_pretrained` to load
the model weights
Args:
config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`:
The model class to instantiate is selected based on the configuration class: The model class to instantiate is selected based on the configuration class:
- isInstance of `bert` configuration class: BertModel (Bert model) - isInstance of `bert` configuration class: BertModel (Bert model)