AutoModelForUniversalSegmentation

class transformers.AutoModelForUniversalSegmentation  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a universal image segmentation head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
DetrConfig configuration class: DetrForSegmentation (DETR model)
Mask2FormerConfig configuration class: Mask2FormerForUniversalSegmentation (Mask2Former model)
MaskFormerConfig configuration class: MaskFormerForInstanceSegmentation (MaskFormer model)
OneFormerConfig configuration class: OneFormerForUniversalSegmentation (OneFormer model)
    Instantiates one of the model classes of the library (with a universal image segmentation head) f


AutoModelForUniversalSegmentation

rom a configuration. Note:
Loading a model from its configuration file does not load the model weights. It only affects the
model’s configuration. Use from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForUniversalSegmentation
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForUniversalSegmentation.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorfl


AutoModelForUniversalSegmentation

ow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   sta


AutoModelForUniversalSegmentation

te_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received


AutoModelForUniversalSegmentation

files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files.


AutoModelForUniversalSegmentation

 This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already bee


AutoModelForUniversalSegmentation

n done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a universal image segmentation head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: detr — DetrForSegmentation (DETR model) mask2former — Mask2FormerForUniversalSegmentation (Mask2Former model) maskformer — MaskFormerForInstanceSegmentation (MaskFormer model) one


AutoModelForUniversalSegmentation

former — OneFormerForUniversalSegmentation (OneFormer model) The model is set in evaluation mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForUniversalSegmentation
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForUniversalSegmentation.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForUniversalSegmentation.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForUniversalSegmentation.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=config
.


AutoModelForZeroShotImageClassification

class transformers.AutoModelForZeroShotImageClassification  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a zero-shot image classification head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
AlignConfig configuration class: AlignModel (ALIGN model)
AltCLIPConfig configuration class: AltCLIPModel (AltCLIP model)
BlipConfig configuration class: BlipModel (BLIP model)
CLIPConfig configuration class: CLIPModel (CLIP model)
CLIPSegConfig configuration class: CLIPSegModel (CLIPSeg model)
ChineseCLIPConfig configuration c


AutoModelForZeroShotImageClassification

lass: ChineseCLIPModel (Chinese-CLIP model)
    Instantiates one of the model classes of the library (with a zero-shot image classification head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForZeroShotImageClassification
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForZeroShotImageClassification.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be locate


AutoModelForZeroShotImageClassification

d at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded


AutoModelForZeroShotImageClassification

 when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not


AutoModelForZeroShotImageClassification

 be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and err


AutoModelForZeroShotImageClassification

or messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different reposi


AutoModelForZeroShotImageClassification

tory than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will


AutoModelForZeroShotImageClassification

be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a zero-shot image classification head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: align — AlignModel (ALIGN model) altclip — AltCLIPModel (AltCLIP model) blip — BlipModel (BLIP model) chinese_clip — ChineseCLIPModel (Chinese-CLIP model) clip — CLIPModel (CLIP model) clipseg — CLIPSegModel (CLIPSeg model) The model is set in evaluation mode by default using model.eval


AutoModelForZeroShotImageClassification

() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForZeroShotImageClassification
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForZeroShotImageClassification.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForZeroShotImageClassification.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForZeroShotImageClassification.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=conf


class transformers.TFAutoModelForZeroShotImageClassification  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a zero-shot image classification head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
BlipConfig configuration class: TFBlipModel (BLIP model)
CLIPConfig configuration class: TFCLIPModel (CLIP model)
    Instantiates one of the model classes of the library (with a zero-shot image classification head) from a configuration. Note:
Loading a model from its configuration file does not load the model weigh


ts. It only affects the
model’s configuration. Use from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, TFAutoModelForZeroShotImageClassification
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = TFAutoModelForZeroShotImageClassification.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory


/.
A path or url to a PyTorch state_dict save file (e.g, ./pt_model/pytorch_model.bin). In this
case, from_pt should be set to True and a configuration object should be provided as config
argument. This loading path is slower than converting the PyTorch model in a TensorFlow model
using the provided conversion scripts and loading the TensorFlow model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by sup


plying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_pt (bool, optional, defaults to False) —
Load the model weights from a PyTorch checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A diction


ary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files.


 This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly pass


ed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a zero-shot image classification head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using


pattern matching on pretrained_model_name_or_path: blip — TFBlipModel (BLIP model) clip — TFCLIPModel (CLIP model)  Examples:   Copied >>> from transformers import AutoConfig, TFAutoModelForZeroShotImageClassification
>>> # Download model and configuration from huggingface.co and cache.
>>> model = TFAutoModelForZeroShotImageClassification.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = TFAutoModelForZeroShotImageClassification.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a PyTorch checkpoint file instead of a TensorFlow model (slower)
>>> config = AutoConfig.from_pretrained("./pt_model/bert_pt_model_config.json")
>>> model = TFAutoModelForZeroShotImageClassification.from_pretrained(
...     "./pt_model/bert_pytorch_model.bin", from_pt=True, config=config
...


AutoModelForZeroShotObjectDetection

class transformers.AutoModelForZeroShotObjectDetection  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a zero-shot object detection head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
OwlViTConfig configuration class: OwlViTForObjectDetection (OWL-ViT model)
    Instantiates one of the model classes of the library (with a zero-shot object detection head) 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 from_pretrained() to load the model weights.  Examples:   Co


AutoModelForZeroShotObjectDetection

pied >>> from transformers import AutoConfig, AutoModelForZeroShotObjectDetection
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForZeroShotObjectDetection.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided


AutoModelForZeroShotObjectDetection

as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dict


AutoModelForZeroShotObjectDetection

ionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the downl


AutoModelForZeroShotObjectDetection

oad if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their ow


AutoModelForZeroShotObjectDetection

n modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ met


AutoModelForZeroShotObjectDetection

hod (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a zero-shot object detection head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: owlvit — OwlViTForObjectDetection (OWL-ViT model) Th


AutoModelForZeroShotObjectDetection

e model is set in evaluation mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForZeroShotObjectDetection
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForZeroShotObjectDetection.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForZeroShotObjectDetection.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForZeroShotObjectDetection.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=config


AutoModelForAudioClassification

class transformers.AutoModelForAudioClassification  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a audio classification head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
ASTConfig configuration class: ASTForAudioClassification (Audio Spectrogram Transformer model)
Data2VecAudioConfig configuration class: Data2VecAudioForSequenceClassification (Data2VecAudio model)
HubertConfig configuration class: HubertForSequenceClassification (Hubert model)
SEWConfig configuration class: SEWForSequenceClassification (SEW model)
SEWDConfig


AutoModelForAudioClassification

 configuration class: SEWDForSequenceClassification (SEW-D model)
UniSpeechConfig configuration class: UniSpeechForSequenceClassification (UniSpeech model)
UniSpeechSatConfig configuration class: UniSpeechSatForSequenceClassification (UniSpeechSat model)
Wav2Vec2Config configuration class: Wav2Vec2ForSequenceClassification (Wav2Vec2 model)
Wav2Vec2ConformerConfig configuration class: Wav2Vec2ConformerForSequenceClassification (Wav2Vec2-Conformer model)
WavLMConfig configuration class: WavLMForSequenceClassification (WavLM model)
WhisperConfig configuration class: WhisperForAudioClassification (Whisper model)
    Instantiates one of the model classes of the library (with a audio classification head) 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 from_pretrained() to load the model weights.


AutoModelForAudioClassification

Examples:   Copied >>> from transformers import AutoConfig, AutoModelForAudioClassification
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForAudioClassification.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a


AutoModelForAudioClassification

 configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str,


AutoModelForAudioClassification

torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, option


AutoModelForAudioClassification

al, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier


AutoModelForAudioClassification

allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently d


AutoModelForAudioClassification

epending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a audio classification head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument


AutoModelForAudioClassification

 or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: audio-spectrogram-transformer — ASTForAudioClassification (Audio Spectrogram Transformer model) data2vec-audio — Data2VecAudioForSequenceClassification (Data2VecAudio model) hubert — HubertForSequenceClassification (Hubert model) sew — SEWForSequenceClassification (SEW model) sew-d — SEWDForSequenceClassification (SEW-D model) unispeech — UniSpeechForSequenceClassification (UniSpeech model) unispeech-sat — UniSpeechSatForSequenceClassification (UniSpeechSat model) wav2vec2 — Wav2Vec2ForSequenceClassification (Wav2Vec2 model) wav2vec2-conformer — Wav2Vec2ConformerForSequenceClassification (Wav2Vec2-Conformer model) wavlm — WavLMForSequenceClassification (WavLM model) whisper — WhisperForAudioClassification (Whisper model) The model is set


AutoModelForAudioClassification

in evaluation mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForAudioClassification
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForAudioClassification.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForAudioClassification.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForAudioClassification.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=con


AutoModelForAudioFrameClassification

class transformers.TFAutoModelForAudioClassification  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a audio classification head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
Wav2Vec2Config configuration class: TFWav2Vec2ForSequenceClassification (Wav2Vec2 model)
    Instantiates one of the model classes of the library (with a audio classification head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, TFAuto


AutoModelForAudioFrameClassification

ModelForAudioClassification
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = TFAutoModelForAudioClassification.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a PyTorch state_dict save file (e.g, ./pt_model/pytorch_model.bin). In this
case, from_pt should be set to True and a configuration object should be provided as config
argument. This loading path is slower than converting the PyTorch model in a TensorFlow model
using t


AutoModelForAudioFrameClassification

he provided conversion scripts and loading the TensorFlow model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_pt (bool, optional, defaults to False) —
Load the model weights from a PyTorch ch


AutoModelForAudioFrameClassification

eckpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
T


AutoModelForAudioFrameClassification

he specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update t


AutoModelForAudioFrameClassification

he configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a audio classification head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config


AutoModelForAudioFrameClassification

 object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: wav2vec2 — TFWav2Vec2ForSequenceClassification (Wav2Vec2 model)  Examples:   Copied >>> from transformers import AutoConfig, TFAutoModelForAudioClassification
>>> # Download model and configuration from huggingface.co and cache.
>>> model = TFAutoModelForAudioClassification.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = TFAutoModelForAudioClassification.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a PyTorch checkpoint file instead of a TensorFlow model (slower)
>>> config = AutoConfig.from_pretrained("./pt_model/bert_pt_model_config.json")
>>> model = TFAutoModelForAudioClassification.from_pretrained(
...     "./pt_model/bert_pytorch_model.bin", from_pt=True, config=config
.


TFAutoModelForAudioFrameClassification

class transformers.AutoModelForAudioFrameClassification  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a audio frame (token) classification head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
Data2VecAudioConfig configuration class: Data2VecAudioForAudioFrameClassification (Data2VecAudio model)
UniSpeechSatConfig configuration class: UniSpeechSatForAudioFrameClassification (UniSpeechSat model)
Wav2Vec2Config configuration class: Wav2Vec2ForAudioFrameClassification (Wav2Vec2 model)
Wav2Vec2ConformerConfig configuration class: Wav2Vec2ConformerF


TFAutoModelForAudioFrameClassification

orAudioFrameClassification (Wav2Vec2-Conformer model)
WavLMConfig configuration class: WavLMForAudioFrameClassification (WavLM model)
    Instantiates one of the model classes of the library (with a audio frame (token) classification head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForAudioFrameClassification
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForAudioFrameClassification.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a


TFAutoModelForAudioFrameClassification

model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configurati


TFAutoModelForAudioFrameClassification

on can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should no


TFAutoModelForAudioFrameClassification

t be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_o


TFAutoModelForAudioFrameClassification

nly(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name,


TFAutoModelForAudioFrameClassification

 a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that


TFAutoModelForAudioFrameClassification

 do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a audio frame (token) classification head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: data2vec-audio — Data2VecAudioForAudioFrameClassification (Data2VecAudio model) unispeech-sat — UniSpeechSatForAudioFrameClassification (UniSpeechSat model) wav2vec2 — Wav2Vec2ForAudioFrameClassification (Wav2Vec2 model) wav2vec2-conformer — Wav2Vec2ConformerForAudioFrameClassification (Wav2Vec2-Conformer model) wavlm — WavLMForAudioFrameClassification (WavLM model) The model is set in evaluatio


TFAutoModelForAudioFrameClassification

n mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForAudioFrameClassification
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForAudioFrameClassification.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForAudioFrameClassification.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForAudioFrameClassification.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=config
...


AutoModelForCTC

class transformers.AutoModelForCTC  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a connectionist temporal classification head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
Data2VecAudioConfig configuration class: Data2VecAudioForCTC (Data2VecAudio model)
HubertConfig configuration class: HubertForCTC (Hubert model)
MCTCTConfig configuration class: MCTCTForCTC (M-CTC-T model)
SEWConfig configuration class: SEWForCTC (SEW model)
SEWDConfig configuration class: SEWDForCTC (SEW-D model)
UniSpeechConfig configuration class: UniSpeechForCTC (UniSpeech model)
Uni


AutoModelForCTC

SpeechSatConfig configuration class: UniSpeechSatForCTC (UniSpeechSat model)
Wav2Vec2Config configuration class: Wav2Vec2ForCTC (Wav2Vec2 model)
Wav2Vec2ConformerConfig configuration class: Wav2Vec2ConformerForCTC (Wav2Vec2-Conformer model)
WavLMConfig configuration class: WavLMForCTC (WavLM model)
    Instantiates one of the model classes of the library (with a connectionist temporal classification head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForCTC
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForCTC.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_


AutoModelForCTC

name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —


AutoModelForCTC

Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a download


AutoModelForCTC

ed pretrained model configuration should be cached if the
standard cache should not be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containin


AutoModelForCTC

g missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository


AutoModelForCTC

than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
suppl


AutoModelForCTC

ied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a connectionist temporal classification head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: data2vec-audio — Data2VecAudioForCTC (Data2VecAudio model) hubert — HubertForCTC (Hubert model) mctct — MCTCTForCTC (M-CTC-T model) sew — SEWForCTC (SEW model) sew-d — SEWDForCTC (SEW-D model) unispeech — UniSpeechForCTC (UniSpeech model) unispeech-sat — UniSpeechSatForCTC (UniSpeechSat model) wav2vec2 — Wav2Vec2ForCTC (Wav2Vec2 model) wav2vec2-conformer — Wav2Vec2Confor


AutoModelForCTC

merForCTC (Wav2Vec2-Conformer model) wavlm — WavLMForCTC (WavLM model) The model is set in evaluation mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForCTC
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForCTC.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForCTC.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForCTC.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=config
...


class transformers.AutoModelForSpeechSeq2Seq  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
Pop2PianoConfig configuration class: Pop2PianoForConditionalGeneration (Pop2Piano model)
Speech2TextConfig configuration class: Speech2TextForConditionalGeneration (Speech2Text model)
SpeechEncoderDecoderConfig configuration class: SpeechEncoderDecoderModel (Speech Encoder decoder model)
SpeechT5Config configuration class: SpeechT5ForSpeechT


oText (SpeechT5 model)
WhisperConfig configuration class: WhisperForConditionalGeneration (Whisper model)
    Instantiates one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForSpeechSeq2Seq
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForSpeechSeq2Seq.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface


.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be


automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache shou


ld not be used.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messa


ges.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of


the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute w


ith the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: pop2piano — Pop2PianoForConditionalGeneration (Pop2Piano model) speech-encoder-decoder — SpeechEncoderDecoderModel (Speech Encoder decoder model) speech_to_text — Speech2TextForConditionalGeneration (Speech2Text model) speecht5 — SpeechT5ForSpeechToText (SpeechT5 model) whisper — WhisperForConditionalGeneration (Whisper m


odel) The model is set in evaluation mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForSpeechSeq2Seq
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForSpeechSeq2Seq.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForSpeechSeq2Seq.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForSpeechSeq2Seq.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=confi


class transformers.TFAutoModelForSpeechSeq2Seq  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
Speech2TextConfig configuration class: TFSpeech2TextForConditionalGeneration (Speech2Text model)
WhisperConfig configuration class: TFWhisperForConditionalGeneration (Whisper model)
    Instantiates one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) from a configuration. Note:
L


oading a model from its configuration file does not load the model weights. It only affects the
model’s configuration. Use from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, TFAutoModelForSpeechSeq2Seq
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = TFAutoModelForSpeechSeq2Seq.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretra


ined(), e.g., ./my_model_directory/.
A path or url to a PyTorch state_dict save file (e.g, ./pt_model/pytorch_model.bin). In this
case, from_pt should be set to True and a configuration object should be provided as config
argument. This loading path is slower than converting the PyTorch model in a TensorFlow model
using the provided conversion scripts and loading the TensorFlow model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
Th


e model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_pt (bool, optional, defaults to False) —
Load the model weights from a PyTorch checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optiona


l) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling fi


les. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to


the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pa


ttern matching on pretrained_model_name_or_path: speech_to_text — TFSpeech2TextForConditionalGeneration (Speech2Text model) whisper — TFWhisperForConditionalGeneration (Whisper model)  Examples:   Copied >>> from transformers import AutoConfig, TFAutoModelForSpeechSeq2Seq
>>> # Download model and configuration from huggingface.co and cache.
>>> model = TFAutoModelForSpeechSeq2Seq.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = TFAutoModelForSpeechSeq2Seq.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a PyTorch checkpoint file instead of a TensorFlow model (slower)
>>> config = AutoConfig.from_pretrained("./pt_model/bert_pt_model_config.json")
>>> model = TFAutoModelForSpeechSeq2Seq.from_pretrained(
...     "./pt_model/bert_pytorch_model.bin", from_pt=True, config=config


class transformers.FlaxAutoModelForSpeechSeq2Seq  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
SpeechEncoderDecoderConfig configuration class: FlaxSpeechEncoderDecoderModel (Speech Encoder decoder model)
WhisperConfig configuration class: FlaxWhisperForConditionalGeneration (Whisper model)
    Instantiates one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) from a configurati


on. Note:
Loading a model from its configuration file does not load the model weights. It only affects the
model’s configuration. Use from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, FlaxAutoModelForSpeechSeq2Seq
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = FlaxAutoModelForSpeechSeq2Seq.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
s


ave_pretrained(), e.g., ./my_model_directory/.
A path or url to a PyTorch state_dict save file (e.g, ./pt_model/pytorch_model.bin). In this
case, from_pt should be set to True and a configuration object should be provided as config
argument. This loading path is slower than converting the PyTorch model in a TensorFlow model
using the provided conversion scripts and loading the TensorFlow model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save director


y.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.   from_pt (bool, optional, defaults to False) —
Load the model weights from a PyTorch checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optiona


l) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error messages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files.


This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underl


ying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a sequence-to-sequence speech-to-text modeling head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching


on pretrained_model_name_or_path: speech-encoder-decoder — FlaxSpeechEncoderDecoderModel (Speech Encoder decoder model) whisper — FlaxWhisperForConditionalGeneration (Whisper model)  Examples:   Copied >>> from transformers import AutoConfig, FlaxAutoModelForSpeechSeq2Seq
>>> # Download model and configuration from huggingface.co and cache.
>>> model = FlaxAutoModelForSpeechSeq2Seq.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = FlaxAutoModelForSpeechSeq2Seq.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a PyTorch checkpoint file instead of a TensorFlow model (slower)
>>> config = AutoConfig.from_pretrained("./pt_model/bert_pt_model_config.json")
>>> model = FlaxAutoModelForSpeechSeq2Seq.from_pretrained(
...     "./pt_model/bert_pytorch_model.bin", from_pt=True, config=config


AutoModelForAudioXVector

class transformers.AutoModelForAudioXVector  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a audio retrieval via x-vector head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
Data2VecAudioConfig configuration class: Data2VecAudioForXVector (Data2VecAudio model)
UniSpeechSatConfig configuration class: UniSpeechSatForXVector (UniSpeechSat model)
Wav2Vec2Config configuration class: Wav2Vec2ForXVector (Wav2Vec2 model)
Wav2Vec2ConformerConfig configuration class: Wav2Vec2ConformerForXVector (Wav2Vec2-Conformer model)
W


AutoModelForAudioXVector

avLMConfig configuration class: WavLMForXVector (WavLM model)
    Instantiates one of the model classes of the library (with a audio retrieval via x-vector head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForAudioXVector
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("bert-base-cased")
>>> model = AutoModelForAudioXVector.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the roo


AutoModelForAudioXVector

t-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided as
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The


AutoModelForAudioXVector

 model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionary loaded from saved weights file.
This option can be used if you want to create a model from a pretrained configuration but load your own
weights. In this case though, you should check if using save_pretrained() and
from_pretrained() is not a simpler option.   cache_dir (str or os.PathLike, optional) —
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used


AutoModelForAudioXVector

.   from_tf (bool, optional, defaults to False) —
Load the model weights from a TensorFlow checkpoint save file (see docstring of
pretrained_model_name_or_path argument).   force_download (bool, optional, defaults to False) —
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.   resume_download (bool, optional, defaults to False) —
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.   proxies (Dict[str, str], optional) —
A dictionary of proxy servers to use by protocol or endpoint, e.g., {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.   output_loading_info(bool, optional, defaults to False) —
Whether ot not to also return a dictionary containing missing keys, unexpected keys and error mes


AutoModelForAudioXVector

sages.   local_files_only(bool, optional, defaults to False) —
Whether or not to only look at local files (e.g., not try downloading the model).   revision (str, optional, defaults to "main") —
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so revision can be any
identifier allowed by git.   trust_remote_code (bool, optional, defaults to False) —
Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
should only be set to True for repositories you trust and in which you have read the code, as it will
execute code present on the Hub on your local machine.   code_revision (str, optional, defaults to "main") —
The specific revision to use for the code on the Hub, if the code leaves in a different repository


AutoModelForAudioXVector

 than
the rest of the model. It can be a branch name, a tag name, or a commit id, since we use a git-based
system for storing models and other artifacts on huggingface.co, so revision can be any identifier
allowed by git.   kwargs (additional keyword arguments, optional) —
Can be used to update the configuration object (after it being loaded) and initiate the model (e.g.,
output_attentions=True). Behaves differently depending on whether a config is provided or
automatically loaded:
If a configuration is provided with config, **kwargs will be directly passed to the
underlying model’s __init__ method (we assume all relevant updates to the configuration have
already been done)
If a configuration is not provided, kwargs will be first passed to the configuration class
initialization function (from_pretrained()). Each key of kwargs that
corresponds to a configuration attribute will be


AutoModelForAudioXVector

 used to override said attribute with the
supplied kwargs value. Remaining keys that do not correspond to any configuration attribute
will be passed to the underlying model’s __init__ function.
    Instantiate one of the model classes of the library (with a audio retrieval via x-vector head) from a pretrained model. The model class to instantiate is selected based on the model_type property of the config object (either
passed as an argument or loaded from pretrained_model_name_or_path if possible), or when it’s missing, by
falling back to using pattern matching on pretrained_model_name_or_path: data2vec-audio — Data2VecAudioForXVector (Data2VecAudio model) unispeech-sat — UniSpeechSatForXVector (UniSpeechSat model) wav2vec2 — Wav2Vec2ForXVector (Wav2Vec2 model) wav2vec2-conformer — Wav2Vec2ConformerForXVector (Wav2Vec2-Conformer model) wavlm — WavLMForXVector (WavLM model) The m


AutoModelForAudioXVector

odel is set in evaluation mode by default using model.eval() (so for instance, dropout modules are
deactivated). To train the model, you should first set it back in training mode with model.train()  Examples:   Copied >>> from transformers import AutoConfig, AutoModelForAudioXVector
>>> # Download model and configuration from huggingface.co and cache.
>>> model = AutoModelForAudioXVector.from_pretrained("bert-base-cased")
>>> # Update configuration during loading
>>> model = AutoModelForAudioXVector.from_pretrained("bert-base-cased", output_attentions=True)
>>> model.config.output_attentions
True
>>> # Loading from a TF checkpoint file instead of a PyTorch model (slower)
>>> config = AutoConfig.from_pretrained("./tf_model/bert_tf_model_config.json")
>>> model = AutoModelForAudioXVector.from_pretrained(
...     "./tf_model/bert_tf_checkpoint.ckpt.index", from_tf=True, config=conf


AutoModelForTableQuestionAnswering

class transformers.AutoModelForTableQuestionAnswering  < source > ( *args **kwargs  )    This is a generic model class that will be instantiated as one of the model classes of the library (with a table question answering head) when created
with the from_pretrained() class method or the from_config() class
method. This class cannot be instantiated directly using __init__() (throws an error).  from_config  < source > ( **kwargs  )   Parameters   config (PretrainedConfig) —
The model class to instantiate is selected based on the configuration class:
TapasConfig configuration class: TapasForQuestionAnswering (TAPAS model)
    Instantiates one of the model classes of the library (with a table question answering head) 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 from_pretrained() to load the model weights.  Examples:   Copied >>> fr


AutoModelForTableQuestionAnswering

om transformers import AutoConfig, AutoModelForTableQuestionAnswering
>>> # Download configuration from huggingface.co and cache.
>>> config = AutoConfig.from_pretrained("google/tapas-base-finetuned-wtq")
>>> model = AutoModelForTableQuestionAnswering.from_config(config)  from_pretrained  < source > ( *model_args **kwargs  )   Parameters   pretrained_model_name_or_path (str or os.PathLike) —
Can be either:
A string, the model id of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a
user or organization name, like dbmdz/bert-base-german-cased.
A path to a directory containing model weights saved using
save_pretrained(), e.g., ./my_model_directory/.
A path or url to a tensorflow index checkpoint file (e.g, ./tf_model/model.ckpt.index). In
this case, from_tf should be set to True and a configuration object should be provided a


AutoModelForTableQuestionAnswering

s
config argument. This loading path is slower than converting the TensorFlow checkpoint in a
PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards.
   model_args (additional positional arguments, optional) —
Will be passed along to the underlying model __init__() method.   config (PretrainedConfig, optional) —
Configuration for the model to use instead of an automatically loaded configuration. Configuration can
be automatically loaded when:
The model is a model provided by the library (loaded with the model id string of a pretrained
model).
The model was saved using save_pretrained() and is reloaded by supplying the
save directory.
The model is loaded by supplying a local directory as pretrained_model_name_or_path and a
configuration JSON file named config.json is found in the directory.
   state_dict (Dict[str, torch.Tensor], optional) —
A state dictionary to use instead of a state dictionar