text
stringlengths 5
58.6k
| source
stringclasses 470
values | url
stringlengths 49
167
| source_section
stringlengths 0
90
| file_type
stringclasses 1
value | id
stringlengths 3
6
|
---|---|---|---|---|---|
The XLMProphetNet Model with a language modeling head. Can be used for sequence generation tasks.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
Original ProphetNet code can be found [here](https://github.com/microsoft/ProphetNet). Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py`.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.
Parameters:
config ([`XLMProphetNetConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/xlm-prophetnet.md | https://huggingface.co/docs/transformers/en/model_doc/xlm-prophetnet/#xlmprophetnetforconditionalgeneration | #xlmprophetnetforconditionalgeneration | .md | 209_9 |
The standalone decoder part of the XLMProphetNetModel with a lm head on top. The model can be used for causal language modeling.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
Original ProphetNet code can be found [here](https://github.com/microsoft/ProphetNet). Checkpoints were converted
from original Fairseq checkpoints. For more information on the checkpoint conversion, please take a look at the
file `convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py`.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matters related to general usage and
behavior.
Parameters:
config ([`XLMProphetNetConfig`]): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/xlm-prophetnet.md | https://huggingface.co/docs/transformers/en/model_doc/xlm-prophetnet/#xlmprophetnetforcausallm | #xlmprophetnetforcausallm | .md | 209_10 |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
--> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/ | .md | 210_0 |
|
<Tip warning={true}>
This model is in maintenance mode only, we don't accept any new PRs changing its code.
If you run into any issues running this model, please reinstall the last version that supported this model: v4.31.0.
You can do so by running the following command: `pip install -U transformers==4.31.0`.
</Tip>
<Tip warning={true}>
This model differs from the [OpenLLaMA models](https://huggingface.co/models?search=openllama) on the Hugging Face Hub, which primarily use the [LLaMA](llama) architecture.
</Tip> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/#open-llama | #open-llama | .md | 210_1 |
The Open-Llama model was proposed in the open source Open-Llama project by community developer s-JoL.
The model is mainly based on LLaMA with some modifications, incorporating memory-efficient attention from Xformers, stable embedding from Bloom, and shared input-output embedding from PaLM.
And the model is pre-trained on both Chinese and English, which gives it better performance on Chinese language tasks.
This model was contributed by [s-JoL](https://huggingface.co/s-JoL).
The original code was released on GitHub by [s-JoL](https://github.com/s-JoL), but is now removed. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/#overview | #overview | .md | 210_2 |
This is the configuration class to store the configuration of a [`OpenLlamaModel`]. It is used to instantiate an
Open-Llama model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the
[s-JoL/Open-Llama-V1](https://huggingface.co/s-JoL/Open-Llama-V1).
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 32000):
Vocabulary size of the Open-Llama model. Defines the number of different tokens that can be represented by
the `inputs_ids` passed when calling [`OpenLlamaModel`]
hidden_size (`int`, *optional*, defaults to 4096):
Dimension of the hidden representations.
intermediate_size (`int`, *optional*, defaults to 11008):
Dimension of the MLP representations.
num_hidden_layers (`int`, *optional*, defaults to 32):
Number of hidden layers in the Transformer encoder.
num_attention_heads (`int`, *optional*, defaults to 32):
Number of attention heads for each attention layer in the Transformer encoder.
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
The non-linear activation function (function or string) in the decoder.
max_position_embeddings (`int`, *optional*, defaults to 2048):
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).
initializer_range (`float`, *optional*, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
rms_norm_eps (`float`, *optional*, defaults to 1e-12):
The epsilon used by the rms normalization layers.
use_cache (`bool`, *optional*, defaults to `True`):
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if `config.is_decoder=True`.
tie_word_embeddings(`bool`, *optional*, defaults to `False`):
Whether to tie weight embeddings
rope_theta (`float`, *optional*, defaults to 10000.0):
The base period of the RoPE embeddings.
rope_scaling (`Dict`, *optional*):
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
`max_position_embeddings` to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
experimental feature, subject to breaking API changes in future versions.
Example:
```python
>>> from transformers import OpenLlamaModel, OpenLlamaConfig
>>> # Initializing a Open-Llama open_llama-7b style configuration
>>> configuration = OpenLlamaConfig()
>>> # Initializing a model from the open_llama-7b style configuration
>>> model = OpenLlamaModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
``` | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/#openllamaconfig | #openllamaconfig | .md | 210_3 |
The bare Open-Llama Model outputting raw hidden-states without any specific head on top.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.
Parameters:
config ([`OpenLlamaConfig`]):
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`OpenLlamaDecoderLayer`]
Args:
config: OpenLlamaConfig
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/#openllamamodel | #openllamamodel | .md | 210_4 |
No docstring available for OpenLlamaForCausalLM
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/#openllamaforcausallm | #openllamaforcausallm | .md | 210_5 |
The LLaMa Model transformer with a sequence classification head on top (linear layer).
[`OpenLlamaForSequenceClassification`] uses the last token in order to do the classification, as other causal
models (e.g. GPT-2) do.
Since it does classification on the last token, it requires to know the position of the last token. If a
`pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
each row of the batch).
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.
Parameters:
config ([`OpenLlamaConfig`]):
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/open-llama.md | https://huggingface.co/docs/transformers/en/model_doc/open-llama/#openllamaforsequenceclassification | #openllamaforsequenceclassification | .md | 210_6 |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
--> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/ | .md | 211_0 |
|
The Phi-1 model was proposed in [Textbooks Are All You Need](https://arxiv.org/abs/2306.11644) by Suriya Gunasekar, Yi Zhang, Jyoti Aneja, Caio César Teodoro Mendes, Allie Del Giorno, Sivakanth Gopi, Mojan Javaheripi, Piero Kauffmann, Gustavo de Rosa, Olli Saarikivi, Adil Salim, Shital Shah, Harkirat Singh Behl, Xin Wang, Sébastien Bubeck, Ronen Eldan, Adam Tauman Kalai, Yin Tat Lee and Yuanzhi Li.
The Phi-1.5 model was proposed in [Textbooks Are All You Need II: phi-1.5 technical report](https://arxiv.org/abs/2309.05463) by Yuanzhi Li, Sébastien Bubeck, Ronen Eldan, Allie Del Giorno, Suriya Gunasekar and Yin Tat Lee. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#overview | #overview | .md | 211_1 |
In Phi-1 and Phi-1.5 papers, the authors showed how important the quality of the data is in training relative to the model size.
They selected high quality "textbook" data alongside with synthetically generated data for training their small sized Transformer
based model Phi-1 with 1.3B parameters. Despite this small scale, phi-1 attains pass@1 accuracy 50.6% on HumanEval and 55.5% on MBPP.
They follow the same strategy for Phi-1.5 and created another 1.3B parameter model with performance on natural language tasks comparable
to models 5x larger, and surpassing most non-frontier LLMs. Phi-1.5 exhibits many of the traits of much larger LLMs such as the ability
to “think step by step” or perform some rudimentary in-context learning.
With these two experiments the authors successfully showed the huge impact of quality of training data when training machine learning models.
The abstract from the Phi-1 paper is the following:
*We introduce phi-1, a new large language model for code, with significantly smaller size than
competing models: phi-1 is a Transformer-based model with 1.3B parameters, trained for 4 days on
8 A100s, using a selection of “textbook quality” data from the web (6B tokens) and synthetically
generated textbooks and exercises with GPT-3.5 (1B tokens). Despite this small scale, phi-1 attains
pass@1 accuracy 50.6% on HumanEval and 55.5% on MBPP. It also displays surprising emergent
properties compared to phi-1-base, our model before our finetuning stage on a dataset of coding
exercises, and phi-1-small, a smaller model with 350M parameters trained with the same pipeline as
phi-1 that still achieves 45% on HumanEval.*
The abstract from the Phi-1.5 paper is the following:
*We continue the investigation into the power of smaller Transformer-based language models as
initiated by TinyStories – a 10 million parameter model that can produce coherent English – and
the follow-up work on phi-1, a 1.3 billion parameter model with Python coding performance close
to the state-of-the-art. The latter work proposed to use existing Large Language Models (LLMs) to
generate “textbook quality” data as a way to enhance the learning process compared to traditional
web data. We follow the “Textbooks Are All You Need” approach, focusing this time on common
sense reasoning in natural language, and create a new 1.3 billion parameter model named phi-1.5,
with performance on natural language tasks comparable to models 5x larger, and surpassing most
non-frontier LLMs on more complex reasoning tasks such as grade-school mathematics and basic
coding. More generally, phi-1.5 exhibits many of the traits of much larger LLMs, both good –such
as the ability to “think step by step” or perform some rudimentary in-context learning– and bad,
including hallucinations and the potential for toxic and biased generations –encouragingly though, we
are seeing improvement on that front thanks to the absence of web data. We open-source phi-1.5 to
promote further research on these urgent topics.*
This model was contributed by [Susnato Dhar](https://huggingface.co/susnato).
The original code for Phi-1, Phi-1.5 and Phi-2 can be found [here](https://huggingface.co/microsoft/phi-1), [here](https://huggingface.co/microsoft/phi-1_5) and [here](https://huggingface.co/microsoft/phi-2), respectively. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#summary | #summary | .md | 211_2 |
- This model is quite similar to `Llama` with the main difference in [`PhiDecoderLayer`], where they used [`PhiAttention`] and [`PhiMLP`] layers in parallel configuration.
- The tokenizer used for this model is identical to the [`CodeGenTokenizer`]. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#usage-tips | #usage-tips | .md | 211_3 |
<Tip warning={true}>
Phi-2 has been integrated in the development version (4.37.0.dev) of `transformers`. Until the official version is released through `pip`, ensure that you are doing one of the following:
* When loading the model, ensure that `trust_remote_code=True` is passed as an argument of the `from_pretrained()` function.
* Update your local `transformers` to the development version: `pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers`. The previous command is an alternative to cloning and installing from the source.
</Tip>
```python
>>> from transformers import AutoModelForCausalLM, AutoTokenizer
>>> model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2")
>>> tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2")
>>> inputs = tokenizer('Can you help me write a formal email to a potential business partner proposing a joint venture?', return_tensors="pt", return_attention_mask=False)
>>> outputs = model.generate(**inputs, max_length=30)
>>> text = tokenizer.batch_decode(outputs)[0]
>>> print(text)
Can you help me write a formal email to a potential business partner proposing a joint venture?
Input: Company A: ABC Inc.
Company B
``` | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#how-to-use-phi-2 | #how-to-use-phi-2 | .md | 211_4 |
```python
>>> from transformers import PhiForCausalLM, AutoTokenizer
>>> # define the model and tokenizer.
>>> model = PhiForCausalLM.from_pretrained("microsoft/phi-1_5")
>>> tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5")
>>> # feel free to change the prompt to your liking.
>>> prompt = "If I were an AI that had just achieved"
>>> # apply the tokenizer.
>>> tokens = tokenizer(prompt, return_tensors="pt")
>>> # use the model to generate new tokens.
>>> generated_output = model.generate(**tokens, use_cache=True, max_new_tokens=10)
>>> tokenizer.batch_decode(generated_output)[0]
'If I were an AI that had just achieved a breakthrough in machine learning, I would be thrilled'
``` | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#example- | #example- | .md | 211_5 |
First, make sure to install the latest version of Flash Attention 2 to include the sliding window attention feature.
```bash
pip install -U flash-attn --no-build-isolation
```
Make also sure that you have a hardware that is compatible with Flash-Attention 2. Read more about it in the official documentation of flash-attn repository. Make also sure to load your model in half-precision (e.g. `torch.float16``)
To load and run a model using Flash Attention 2, refer to the snippet below:
```python
>>> import torch
>>> from transformers import PhiForCausalLM, AutoTokenizer
>>> # define the model and tokenizer and push the model and tokens to the GPU.
>>> model = PhiForCausalLM.from_pretrained("microsoft/phi-1_5", torch_dtype=torch.float16, attn_implementation="flash_attention_2").to("cuda") # doctest: +SKIP
>>> tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5")
>>> # feel free to change the prompt to your liking.
>>> prompt = "If I were an AI that had just achieved"
>>> # apply the tokenizer.
>>> tokens = tokenizer(prompt, return_tensors="pt").to("cuda")
>>> # use the model to generate new tokens.
>>> generated_output = model.generate(**tokens, use_cache=True, max_new_tokens=10) # doctest: +SKIP
>>> tokenizer.batch_decode(generated_output)[0] # doctest: +SKIP
'If I were an AI that had just achieved a breakthrough in machine learning, I would be thrilled'
``` | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#combining-phi-and-flash-attention-2 | #combining-phi-and-flash-attention-2 | .md | 211_6 |
Below is an expected speedup diagram that compares pure inference time between the native implementation in transformers using `microsoft/phi-1` checkpoint and the Flash Attention 2 version of the model using a sequence length of 2048.
<div style="text-align: center">
<img src="https://huggingface.co/datasets/ybelkada/documentation-images/resolve/main/phi_1_speedup_plot.jpg">
</div> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#expected-speedups | #expected-speedups | .md | 211_7 |
This is the configuration class to store the configuration of a [`PhiModel`]. It is used to instantiate an Phi
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Phi
[microsoft/phi-1](https://huggingface.co/microsoft/phi-1).
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 51200):
Vocabulary size of the Phi model. Defines the number of different tokens that can be represented by the
`inputs_ids` passed when calling [`PhiModel`].
hidden_size (`int`, *optional*, defaults to 2048):
Dimension of the hidden representations.
intermediate_size (`int`, *optional*, defaults to 8192):
Dimension of the MLP representations.
num_hidden_layers (`int`, *optional*, defaults to 24):
Number of hidden layers in the Transformer decoder.
num_attention_heads (`int`, *optional*, defaults to 32):
Number of attention heads for each attention layer in the Transformer decoder.
num_key_value_heads (`int`, *optional*):
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
`num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout [this
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
`num_attention_heads`.
resid_pdrop (`float`, *optional*, defaults to 0.0):
Dropout probability for mlp outputs.
embd_pdrop (`int`, *optional*, defaults to 0.0):
The dropout ratio for the embeddings.
attention_dropout (`float`, *optional*, defaults to 0.0):
The dropout ratio after computing the attention scores.
hidden_act (`str` or `function`, *optional*, defaults to `"gelu_new"`):
The non-linear activation function (function or string) in the decoder.
max_position_embeddings (`int`, *optional*, defaults to 2048):
The maximum sequence length that this model might ever be used with. Phi-1 and Phi-1.5 supports up to 2048
tokens.
initializer_range (`float`, *optional*, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
layer_norm_eps (`float`, *optional*, defaults to 1e-05):
The epsilon used by the rms normalization layers.
use_cache (`bool`, *optional*, defaults to `True`):
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if `config.is_decoder=True`. Whether to tie weight embeddings or not.
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
Whether to tie weight embeddings
rope_theta (`float`, *optional*, defaults to 10000.0):
The base period of the RoPE embeddings.
rope_scaling (`Dict`, *optional*):
Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
and you expect the model to work on longer `max_position_embeddings`, we recommend you to update this value
accordingly.
Expected contents:
`rope_type` (`str`):
The sub-variant of RoPE to use. Can be one of ['default', 'linear', 'dynamic', 'yarn', 'longrope',
'llama3'], with 'default' being the original RoPE implementation.
`factor` (`float`, *optional*):
Used with all rope types except 'default'. The scaling factor to apply to the RoPE embeddings. In
most scaling types, a `factor` of x will enable the model to handle sequences of length x *
original maximum pre-trained length.
`original_max_position_embeddings` (`int`, *optional*):
Used with 'dynamic', 'longrope' and 'llama3'. The original max position embeddings used during
pretraining.
`attention_factor` (`float`, *optional*):
Used with 'yarn' and 'longrope'. The scaling factor to be applied on the attention
computation. If unspecified, it defaults to value recommended by the implementation, using the
`factor` field to infer the suggested value.
`beta_fast` (`float`, *optional*):
Only used with 'yarn'. Parameter to set the boundary for extrapolation (only) in the linear
ramp function. If unspecified, it defaults to 32.
`beta_slow` (`float`, *optional*):
Only used with 'yarn'. Parameter to set the boundary for interpolation (only) in the linear
ramp function. If unspecified, it defaults to 1.
`short_factor` (`List[float]`, *optional*):
Only used with 'longrope'. The scaling factor to be applied to short contexts (<
`original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
`long_factor` (`List[float]`, *optional*):
Only used with 'longrope'. The scaling factor to be applied to long contexts (<
`original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
`low_freq_factor` (`float`, *optional*):
Only used with 'llama3'. Scaling factor applied to low frequency components of the RoPE
`high_freq_factor` (`float`, *optional*):
Only used with 'llama3'. Scaling factor applied to high frequency components of the RoPE
partial_rotary_factor (`float`, *optional*, defaults to 0.5):
Percentage of the query and keys which will have rotary embedding.
qk_layernorm (`bool`, *optional*, defaults to `False`):
Whether or not to normalize the Queries and Keys after projecting the hidden states.
bos_token_id (`int`, *optional*, defaults to 1):
Denotes beginning of sequences token id.
eos_token_id (`int`, *optional*, defaults to 2):
Denotes end of sequences token id.
Example:
```python
>>> from transformers import PhiModel, PhiConfig
>>> # Initializing a Phi-1 style configuration
>>> configuration = PhiConfig.from_pretrained("microsoft/phi-1")
>>> # Initializing a model from the configuration
>>> model = PhiModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
```
<frameworkcontent>
<pt> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#phiconfig | #phiconfig | .md | 211_8 |
The bare Phi Model outputting raw hidden-states without any specific head on top.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.
Parameters:
config ([`PhiConfig`]):
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`PhiDecoderLayer`]
Args:
config: PhiConfig
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#phimodel | #phimodel | .md | 211_9 |
No docstring available for PhiForCausalLM
Methods: forward
- generate | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#phiforcausallm | #phiforcausallm | .md | 211_10 |
The Phi Model transformer with a sequence classification head on top (linear layer).
[`PhiForSequenceClassification`] uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.
Since it does classification on the last token, it requires to know the position of the last token. If a
`pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
each row of the batch).
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.
Parameters:
config ([`PhiConfig`]):
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#phiforsequenceclassification | #phiforsequenceclassification | .md | 211_11 |
The Phi Model transformer with a token classification head on top (a linear layer on top of the hidden-states
output) e.g. for Named-Entity-Recognition (NER) tasks.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.
Parameters:
config ([`PhiConfig`]):
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
Methods: forward
</pt>
</frameworkcontent> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/phi.md | https://huggingface.co/docs/transformers/en/model_doc/phi/#phifortokenclassification | #phifortokenclassification | .md | 211_12 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.
--> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/ | .md | 212_0 |
|
In many cases, the architecture you want to use can be guessed from the name or the path of the pretrained model you
are supplying to the `from_pretrained()` method. AutoClasses are here to do this job for you so that you
automatically retrieve the relevant model given the name/path to the pretrained weights/config/vocabulary.
Instantiating one of [`AutoConfig`], [`AutoModel`], and
[`AutoTokenizer`] will directly create a class of the relevant architecture. For instance
```python
model = AutoModel.from_pretrained("google-bert/bert-base-cased")
```
will create a model that is an instance of [`BertModel`].
There is one class of `AutoModel` for each task, and for each backend (PyTorch, TensorFlow, or Flax). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#auto-classes | #auto-classes | .md | 212_1 |
Each of the auto classes has a method to be extended with your custom classes. For instance, if you have defined a
custom class of model `NewModel`, make sure you have a `NewModelConfig` then you can add those to the auto
classes like this:
```python
from transformers import AutoConfig, AutoModel
AutoConfig.register("new-model", NewModelConfig)
AutoModel.register(NewModelConfig, NewModel)
```
You will then be able to use the auto classes like you would usually do!
<Tip warning={true}>
If your `NewModelConfig` is a subclass of [`~transformers.PretrainedConfig`], make sure its
`model_type` attribute is set to the same key you use when registering the config (here `"new-model"`).
Likewise, if your `NewModel` is a subclass of [`PreTrainedModel`], make sure its
`config_class` attribute is set to the same class you use when registering the model (here
`NewModelConfig`).
</Tip> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#extending-the-auto-classes | #extending-the-auto-classes | .md | 212_2 |
AutoConfig
This is a generic configuration class that will be instantiated as one of the configuration classes of the library
when created with the [`~AutoConfig.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#autoconfig | #autoconfig | .md | 212_3 |
AutoTokenizer
This is a generic tokenizer class that will be instantiated as one of the tokenizer classes of the library when
created with the [`AutoTokenizer.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#autotokenizer | #autotokenizer | .md | 212_4 |
AutoFeatureExtractor
This is a generic feature extractor class that will be instantiated as one of the feature extractor classes of the
library when created with the [`AutoFeatureExtractor.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#autofeatureextractor | #autofeatureextractor | .md | 212_5 |
AutoImageProcessor
This is a generic image processor class that will be instantiated as one of the image processor classes of the
library when created with the [`AutoImageProcessor.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#autoimageprocessor | #autoimageprocessor | .md | 212_6 |
AutoProcessor
This is a generic processor class that will be instantiated as one of the processor classes of the library when
created with the [`AutoProcessor.from_pretrained`] class method.
This class cannot be instantiated directly using `__init__()` (throws an error). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#autoprocessor | #autoprocessor | .md | 212_7 |
The following auto classes are available for instantiating a base model class without a specific head. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#generic-model-classes | #generic-model-classes | .md | 212_8 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error). | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodel | #automodel | .md | 212_9 |
No docstring available for TFAutoModel | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodel | #tfautomodel | .md | 212_10 |
No docstring available for FlaxAutoModel | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodel | #flaxautomodel | .md | 212_11 |
The following auto classes are available for instantiating a model with a pretraining head. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#generic-pretraining-classes | #generic-pretraining-classes | .md | 212_12 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForPreTraining | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforpretraining | #automodelforpretraining | .md | 212_13 |
No docstring available for TFAutoModelForPreTraining | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforpretraining | #tfautomodelforpretraining | .md | 212_14 |
No docstring available for FlaxAutoModelForPreTraining | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforpretraining | #flaxautomodelforpretraining | .md | 212_15 |
The following auto classes are available for the following natural language processing tasks. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#natural-language-processing | #natural-language-processing | .md | 212_16 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForCausalLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforcausallm | #automodelforcausallm | .md | 212_17 |
No docstring available for TFAutoModelForCausalLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforcausallm | #tfautomodelforcausallm | .md | 212_18 |
No docstring available for FlaxAutoModelForCausalLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforcausallm | #flaxautomodelforcausallm | .md | 212_19 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForMaskedLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelformaskedlm | #automodelformaskedlm | .md | 212_20 |
No docstring available for TFAutoModelForMaskedLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelformaskedlm | #tfautomodelformaskedlm | .md | 212_21 |
No docstring available for FlaxAutoModelForMaskedLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelformaskedlm | #flaxautomodelformaskedlm | .md | 212_22 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForMaskGeneration | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelformaskgeneration | #automodelformaskgeneration | .md | 212_23 |
No docstring available for TFAutoModelForMaskGeneration | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelformaskgeneration | #tfautomodelformaskgeneration | .md | 212_24 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForSeq2SeqLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforseq2seqlm | #automodelforseq2seqlm | .md | 212_25 |
No docstring available for TFAutoModelForSeq2SeqLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforseq2seqlm | #tfautomodelforseq2seqlm | .md | 212_26 |
No docstring available for FlaxAutoModelForSeq2SeqLM | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforseq2seqlm | #flaxautomodelforseq2seqlm | .md | 212_27 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForSequenceClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforsequenceclassification | #automodelforsequenceclassification | .md | 212_28 |
No docstring available for TFAutoModelForSequenceClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforsequenceclassification | #tfautomodelforsequenceclassification | .md | 212_29 |
No docstring available for FlaxAutoModelForSequenceClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforsequenceclassification | #flaxautomodelforsequenceclassification | .md | 212_30 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForMultipleChoice | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelformultiplechoice | #automodelformultiplechoice | .md | 212_31 |
No docstring available for TFAutoModelForMultipleChoice | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelformultiplechoice | #tfautomodelformultiplechoice | .md | 212_32 |
No docstring available for FlaxAutoModelForMultipleChoice | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelformultiplechoice | #flaxautomodelformultiplechoice | .md | 212_33 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForNextSentencePrediction | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfornextsentenceprediction | #automodelfornextsentenceprediction | .md | 212_34 |
No docstring available for TFAutoModelForNextSentencePrediction | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelfornextsentenceprediction | #tfautomodelfornextsentenceprediction | .md | 212_35 |
No docstring available for FlaxAutoModelForNextSentencePrediction | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelfornextsentenceprediction | #flaxautomodelfornextsentenceprediction | .md | 212_36 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForTokenClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfortokenclassification | #automodelfortokenclassification | .md | 212_37 |
No docstring available for TFAutoModelForTokenClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelfortokenclassification | #tfautomodelfortokenclassification | .md | 212_38 |
No docstring available for FlaxAutoModelForTokenClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelfortokenclassification | #flaxautomodelfortokenclassification | .md | 212_39 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForQuestionAnswering | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforquestionanswering | #automodelforquestionanswering | .md | 212_40 |
No docstring available for TFAutoModelForQuestionAnswering | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforquestionanswering | #tfautomodelforquestionanswering | .md | 212_41 |
No docstring available for FlaxAutoModelForQuestionAnswering | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforquestionanswering | #flaxautomodelforquestionanswering | .md | 212_42 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForTextEncoding | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfortextencoding | #automodelfortextencoding | .md | 212_43 |
No docstring available for TFAutoModelForTextEncoding | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelfortextencoding | #tfautomodelfortextencoding | .md | 212_44 |
The following auto classes are available for the following computer vision tasks. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#computer-vision | #computer-vision | .md | 212_45 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForDepthEstimation | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfordepthestimation | #automodelfordepthestimation | .md | 212_46 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForImageClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforimageclassification | #automodelforimageclassification | .md | 212_47 |
No docstring available for TFAutoModelForImageClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforimageclassification | #tfautomodelforimageclassification | .md | 212_48 |
No docstring available for FlaxAutoModelForImageClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforimageclassification | #flaxautomodelforimageclassification | .md | 212_49 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForVideoClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforvideoclassification | #automodelforvideoclassification | .md | 212_50 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForKeypointDetection | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforkeypointdetection | #automodelforkeypointdetection | .md | 212_51 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForMaskedImageModeling | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelformaskedimagemodeling | #automodelformaskedimagemodeling | .md | 212_52 |
No docstring available for TFAutoModelForMaskedImageModeling | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelformaskedimagemodeling | #tfautomodelformaskedimagemodeling | .md | 212_53 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForObjectDetection | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforobjectdetection | #automodelforobjectdetection | .md | 212_54 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForImageSegmentation | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforimagesegmentation | #automodelforimagesegmentation | .md | 212_55 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForImageToImage | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforimagetoimage | #automodelforimagetoimage | .md | 212_56 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForSemanticSegmentation | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforsemanticsegmentation | #automodelforsemanticsegmentation | .md | 212_57 |
No docstring available for TFAutoModelForSemanticSegmentation | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforsemanticsegmentation | #tfautomodelforsemanticsegmentation | .md | 212_58 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForInstanceSegmentation | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforinstancesegmentation | #automodelforinstancesegmentation | .md | 212_59 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForUniversalSegmentation | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforuniversalsegmentation | #automodelforuniversalsegmentation | .md | 212_60 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForZeroShotImageClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforzeroshotimageclassification | #automodelforzeroshotimageclassification | .md | 212_61 |
No docstring available for TFAutoModelForZeroShotImageClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforzeroshotimageclassification | #tfautomodelforzeroshotimageclassification | .md | 212_62 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForZeroShotObjectDetection | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforzeroshotobjectdetection | #automodelforzeroshotobjectdetection | .md | 212_63 |
The following auto classes are available for the following audio tasks. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#audio | #audio | .md | 212_64 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForAudioClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforaudioclassification | #automodelforaudioclassification | .md | 212_65 |
No docstring available for TFAutoModelForAudioClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforaudioframeclassification | #automodelforaudioframeclassification | .md | 212_66 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForAudioFrameClassification | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforaudioframeclassification | #tfautomodelforaudioframeclassification | .md | 212_67 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForCTC | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforctc | #automodelforctc | .md | 212_68 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForSpeechSeq2Seq | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforspeechseq2seq | #automodelforspeechseq2seq | .md | 212_69 |
No docstring available for TFAutoModelForSpeechSeq2Seq | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelforspeechseq2seq | #tfautomodelforspeechseq2seq | .md | 212_70 |
No docstring available for FlaxAutoModelForSpeechSeq2Seq | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#flaxautomodelforspeechseq2seq | #flaxautomodelforspeechseq2seq | .md | 212_71 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForAudioXVector | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelforaudioxvector | #automodelforaudioxvector | .md | 212_72 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForTextToSpectrogram | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfortexttospectrogram | #automodelfortexttospectrogram | .md | 212_73 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForTextToWaveform | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfortexttowaveform | #automodelfortexttowaveform | .md | 212_74 |
The following auto classes are available for the following multimodal tasks. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#multimodal | #multimodal | .md | 212_75 |
AutoModel
This is a generic model class that will be instantiated as one of the base model classes of the library when created
with the [`~AutoModel.from_pretrained`] class method or the [`~AutoModel.from_config`] class
method.
This class cannot be instantiated directly using `__init__()` (throws an error).
ForTableQuestionAnswering | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#automodelfortablequestionanswering | #automodelfortablequestionanswering | .md | 212_76 |
No docstring available for TFAutoModelForTableQuestionAnswering | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/auto.md | https://huggingface.co/docs/transformers/en/model_doc/auto/#tfautomodelfortablequestionanswering | #tfautomodelfortablequestionanswering | .md | 212_77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.