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 |
|---|---|---|---|---|---|
Qwen2MoE is a language model series including decoder language models of different model sizes. For each size, we release the base language model and the aligned chat model. Qwen2MoE has the following architectural choices:
- Qwen2MoE is based on the Transformer architecture with SwiGLU activation, attention QKV bias... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#model-details | #model-details | .md | 221_2 |
`Qwen1.5-MoE-A2.7B` and `Qwen1.5-MoE-A2.7B-Chat` can be found on the [Huggingface Hub](https://huggingface.co/Qwen)
In the following, we demonstrate how to use `Qwen1.5-MoE-A2.7B-Chat` for the inference. Note that we have used the ChatML format for dialog, in this demo we show how to leverage `apply_chat_template` fo... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#usage-tips | #usage-tips | .md | 221_3 |
This is the configuration class to store the configuration of a [`Qwen2MoeModel`]. It is used to instantiate a
Qwen2MoE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen1.5-MoE-A2.7B" [Qwen/Qwen... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#qwen2moeconfig | #qwen2moeconfig | .md | 221_4 |
The bare Qwen2MoE 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.)
Th... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#qwen2moemodel | #qwen2moemodel | .md | 221_5 |
No docstring available for Qwen2MoeForCausalLM
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#qwen2moeforcausallm | #qwen2moeforcausallm | .md | 221_6 |
The Qwen2MoE Model transformer with a sequence classification head on top (linear layer).
[`Qwen2MoeForSequenceClassification`] 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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#qwen2moeforsequenceclassification | #qwen2moeforsequenceclassification | .md | 221_7 |
The Qwen2MoE 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 (s... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#qwen2moefortokenclassification | #qwen2moefortokenclassification | .md | 221_8 |
The Qwen2MoE Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layer on top of the hidden-states output to compute `span start logits` and `span end logits`).
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the ge... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/qwen2_moe.md | https://huggingface.co/docs/transformers/en/model_doc/qwen2_moe/#qwen2moeforquestionanswering | #qwen2moeforquestionanswering | .md | 221_9 |
<!--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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/ | .md | 222_0 | |
The SeamlessM4T model was proposed in [SeamlessM4T — Massively Multilingual & Multimodal Machine Translation](https://dl.fbaipublicfiles.com/seamless/seamless_m4t_paper.pdf) by the Seamless Communication team from Meta AI.
This is the **version 1** release of the model. For the updated **version 2** release, refer to... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#overview | #overview | .md | 222_1 |
First, load the processor and a checkpoint of the model:
```python
>>> from transformers import AutoProcessor, SeamlessM4TModel
>>> processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium")
>>> model = SeamlessM4TModel.from_pretrained("facebook/hf-seamless-m4t-medium")
```
You can seamlessly use... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#usage | #usage | .md | 222_2 |
[`SeamlessM4TModel`] can *seamlessly* generate text or speech with few or no changes. Let's target Russian voice translation:
```python
>>> audio_array_from_text = model.generate(**text_inputs, tgt_lang="rus")[0].cpu().numpy().squeeze()
>>> audio_array_from_audio = model.generate(**audio_inputs, tgt_lang="rus")[0].cp... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#speech | #speech | .md | 222_3 |
Similarly, you can generate translated text from audio files or from text with the same model. You only have to pass `generate_speech=False` to [`SeamlessM4TModel.generate`].
This time, let's translate to French.
```python
>>> # from audio
>>> output_tokens = model.generate(**audio_inputs, tgt_lang="fra", generate_sp... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#text | #text | .md | 222_4 |
[`SeamlessM4TModel`] is transformers top level model to generate speech and text, but you can also use dedicated models that perform the task without additional components, thus reducing the memory footprint.
For example, you can replace the audio-to-audio generation snippet with the model dedicated to the S2ST task, t... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#1-use-dedicated-models | #1-use-dedicated-models | .md | 222_5 |
You have the possibility to change the speaker used for speech synthesis with the `spkr_id` argument. Some `spkr_id` works better than other for some languages! | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#2-change-the-speaker-identity | #2-change-the-speaker-identity | .md | 222_6 |
You can use different [generation strategies](./generation_strategies) for speech and text generation, e.g `.generate(input_ids=input_ids, text_num_beams=4, speech_do_sample=True)` which will successively perform beam-search decoding on the text model, and multinomial sampling on the speech model. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#3-change-the-generation-strategy | #3-change-the-generation-strategy | .md | 222_7 |
Use `return_intermediate_token_ids=True` with [`SeamlessM4TModel`] to return both speech and text ! | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#4-generate-speech-and-text-at-the-same-time | #4-generate-speech-and-text-at-the-same-time | .md | 222_8 |
SeamlessM4T features a versatile architecture that smoothly handles the sequential generation of text and speech. This setup comprises two sequence-to-sequence (seq2seq) models. The first model translates the input modality into translated text, while the second model generates speech tokens, known as "unit tokens," fr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#model-architecture | #model-architecture | .md | 222_9 |
The original SeamlessM4T Model transformer which can be used for every tasks available (S2ST, S2TT, T2TT, T2ST).
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 matter related ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tmodel | #seamlessm4tmodel | .md | 222_10 |
The text-to-speech SeamlessM4T Model transformer which can be used for T2ST.
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 matter related to general usage and
behavior.
Par... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tfortexttospeech | #seamlessm4tfortexttospeech | .md | 222_11 |
The speech-to-speech SeamlessM4T Model transformer which can be used for S2ST.
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 matter related to general usage and
behavior.
P... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tforspeechtospeech | #seamlessm4tforspeechtospeech | .md | 222_12 |
The text-to-text SeamlessM4T Model transformer which can be used for T2TT.
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 matter related to general usage and
behavior.
Param... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tfortexttotext | #seamlessm4tfortexttotext | .md | 222_13 |
The speech-to-text SeamlessM4T Model transformer which can be used for S2TT.
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 matter related to general usage and
behavior.
Par... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tforspeechtotext | #seamlessm4tforspeechtotext | .md | 222_14 |
This is the configuration class to store the configuration of a [`~SeamlessM4TModel`]. It is used to instantiate an
SeamlessM4T 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 SeamlessM4T
["fac... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tconfig | #seamlessm4tconfig | .md | 222_15 |
Construct a SeamlessM4T tokenizer.
Adapted from [`RobertaTokenizer`] and [`XLNetTokenizer`]. Based on
[SentencePiece](https://github.com/google/sentencepiece).
The tokenization method is `<language code> <tokens> <eos>` for source language documents, and `<eos> <language
code> <tokens> <eos>` for target language do... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4ttokenizer | #seamlessm4ttokenizer | .md | 222_16 |
Construct a "fast" SeamlessM4T tokenizer (backed by HuggingFace's *tokenizers* library). Based on
[BPE](https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models).
This tokenizer inherits from [`PreTrainedTokenizerFast`] which contains most of the main methods. Users should
refer to th... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4ttokenizerfast | #seamlessm4ttokenizerfast | .md | 222_17 |
Constructs a SeamlessM4T feature extractor.
This feature extractor inherits from [`SequenceFeatureExtractor`] which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.
This class extracts mel-filter bank features from raw speech.
Args:
feature_siz... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tfeatureextractor | #seamlessm4tfeatureextractor | .md | 222_18 |
Constructs a SeamlessM4T processor which wraps a SeamlessM4T feature extractor and a SeamlessM4T tokenizer into a
single processor.
[`SeamlessM4TProcessor`] offers all the functionalities of [`SeamlessM4TFeatureExtractor`] and
[`SeamlessM4TTokenizerFast`]. See the [`~SeamlessM4TProcessor.__call__`] and [`~SeamlessM4T... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tprocessor | #seamlessm4tprocessor | .md | 222_19 |
Code HiFi-GAN vocoder as described in this [repository](https://github.com/facebookresearch/speech-resynthesis).
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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4tcodehifigan | #seamlessm4tcodehifigan | .md | 222_20 |
No docstring available for SeamlessM4THifiGan | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4thifigan | #seamlessm4thifigan | .md | 222_21 |
Transformer bare text-to-unit encoder-decoder. The encoder is a [`SeamlessM4TEncoder`] without embeddings and the decoder is a [`SeamlessM4TDecoder`].
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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4ttexttounitmodel | #seamlessm4ttexttounitmodel | .md | 222_22 |
Transformer text-to-unit encoder-decoder with a language model head. The base encoder-decoder model is a [`SeamlessM4TTextToUnit`].
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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/seamless_m4t.md | https://huggingface.co/docs/transformers/en/model_doc/seamless_m4t/#seamlessm4ttexttounitforconditionalgeneration | #seamlessm4ttexttounitforconditionalgeneration | .md | 222_23 |
<!--Copyright 2021 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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/ | .md | 223_0 | |
The ImageGPT model was proposed in [Generative Pretraining from Pixels](https://openai.com/blog/image-gpt) by Mark
Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, Ilya Sutskever. ImageGPT (iGPT) is a GPT-2-like
model trained to predict the next pixel value, allowing for both unconditional and condi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#overview | #overview | .md | 223_1 |
- ImageGPT is almost exactly the same as [GPT-2](gpt2), with the exception that a different activation
function is used (namely "quick gelu"), and the layer normalization layers don't mean center the inputs. ImageGPT
also doesn't have tied input- and output embeddings.
- As the time- and memory requirements of the atte... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#usage-tips | #usage-tips | .md | 223_2 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with ImageGPT.
<PipelineTag pipeline="image-classification"/>
- Demo notebooks for ImageGPT can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/ImageGPT).
- [`ImageGPTForImageClassifica... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#resources | #resources | .md | 223_3 |
This is the configuration class to store the configuration of a [`ImageGPTModel`] or a [`TFImageGPTModel`]. It is
used to instantiate a GPT-2 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 Ima... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#imagegptconfig | #imagegptconfig | .md | 223_4 |
No docstring available for ImageGPTFeatureExtractor
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#imagegptfeatureextractor | #imagegptfeatureextractor | .md | 223_5 |
Constructs a ImageGPT image processor. This image processor can be used to resize images to a smaller resolution
(such as 32x32 or 64x64), normalize them and finally color quantize them to obtain sequences of "pixel values"
(color clusters).
Args:
clusters (`np.ndarray` or `List[List[int]]`, *optional*):
The color cl... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#imagegptimageprocessor | #imagegptimageprocessor | .md | 223_6 |
The bare ImageGPT Model transformer 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 he... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#imagegptmodel | #imagegptmodel | .md | 223_7 |
The ImageGPT Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).
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 i... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#imagegptforcausalimagemodeling | #imagegptforcausalimagemodeling | .md | 223_8 |
The ImageGPT Model transformer with an image classification head on top (linear layer).
[`ImageGPTForImageClassification`] average-pools the hidden states in order to do the classification.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/imagegpt.md | https://huggingface.co/docs/transformers/en/model_doc/imagegpt/#imagegptforimageclassification | #imagegptforimageclassification | .md | 223_9 |
<!--Copyright 2022 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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/ | .md | 224_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.40.2.
You can do so by running the following command: `pip install -U transformers==4.40.2`.
</Ti... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezha | #nezha | .md | 224_1 |
The Nezha model was proposed in [NEZHA: Neural Contextualized Representation for Chinese Language Understanding](https://arxiv.org/abs/1909.00204) by Junqiu Wei et al.
The abstract from the paper is the following:
*The pre-trained language models have achieved great successes in various natural language understandi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#overview | #overview | .md | 224_2 |
- [Text classification task guide](../tasks/sequence_classification)
- [Token classification task guide](../tasks/token_classification)
- [Question answering task guide](../tasks/question_answering)
- [Masked language modeling task guide](../tasks/masked_language_modeling)
- [Multiple choice task guide](../tasks/multip... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#resources | #resources | .md | 224_3 |
This is the configuration class to store the configuration of an [`NezhaModel`]. It is used to instantiate an Nezha
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 Nezha
[sijunhe/nezha-cn-base]... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhaconfig | #nezhaconfig | .md | 224_4 |
The bare Nezha Model transformer 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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhamodel | #nezhamodel | .md | 224_5 |
Nezha Model with two heads on top as done during the pretraining: a `masked language modeling` head and a `next
sentence prediction (classification)` head.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloa... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhaforpretraining | #nezhaforpretraining | .md | 224_6 |
Nezha Model with a `language modeling` 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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhaformaskedlm | #nezhaformaskedlm | .md | 224_7 |
Nezha Model with a `next sentence prediction (classification)` 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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhafornextsentenceprediction | #nezhafornextsentenceprediction | .md | 224_8 |
Nezha Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE 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 savi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhaforsequenceclassification | #nezhaforsequenceclassification | .md | 224_9 |
Nezha Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloadin... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhaformultiplechoice | #nezhaformultiplechoice | .md | 224_10 |
Nezha Model 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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhafortokenclassification | #nezhafortokenclassification | .md | 224_11 |
Nezha Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `span start logits` and `span end logits`).
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nezha.md | https://huggingface.co/docs/transformers/en/model_doc/nezha/#nezhaforquestionanswering | #nezhaforquestionanswering | .md | 224_12 |
<!--Copyright 2022 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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/ | .md | 225_0 | |
The Audio Spectrogram Transformer model was proposed in [AST: Audio Spectrogram Transformer](https://arxiv.org/abs/2104.01778) by Yuan Gong, Yu-An Chung, James Glass.
The Audio Spectrogram Transformer applies a [Vision Transformer](vit) to audio, by turning audio into an image (spectrogram). The model obtains state-of-... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#overview | #overview | .md | 225_1 |
- When fine-tuning the Audio Spectrogram Transformer (AST) on your own dataset, it's recommended to take care of the input normalization (to make
sure the input has mean of 0 and std of 0.5). [`ASTFeatureExtractor`] takes care of this. Note that it uses the AudioSet
mean and std by default. You can check [`ast/src/get_... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#usage-tips | #usage-tips | .md | 225_2 |
PyTorch includes a native scaled dot-product attention (SDPA) operator as part of `torch.nn.functional`. This function
encompasses several implementations that can be applied depending on the inputs and the hardware in use. See the
[official documentation](https://pytorch.org/docs/stable/generated/torch.nn.functional.s... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#using-scaled-dot-product-attention-sdpa | #using-scaled-dot-product-attention-sdpa | .md | 225_3 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with the Audio Spectrogram Transformer.
<PipelineTag pipeline="audio-classification"/>
- A notebook illustrating inference with AST for audio classification can be found [here](https://github.com/NielsRogge/Transformer... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#resources | #resources | .md | 225_4 |
This is the configuration class to store the configuration of a [`ASTModel`]. It is used to instantiate an AST
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 AST
[MIT/ast-finetuned-audioset-10... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#astconfig | #astconfig | .md | 225_5 |
Constructs a Audio Spectrogram Transformer (AST) feature extractor.
This feature extractor inherits from [`~feature_extraction_sequence_utils.SequenceFeatureExtractor`] which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.
This class extracts me... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#astfeatureextractor | #astfeatureextractor | .md | 225_6 |
The bare AST Model transformer outputting raw hidden-states without any specific head on top.
This model is 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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#astmodel | #astmodel | .md | 225_7 |
Audio Spectrogram Transformer model with an audio classification head on top (a linear layer on top of the pooled
output) e.g. for datasets like AudioSet, Speech Commands v2.
This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it
as a regular PyTorch Module... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/audio-spectrogram-transformer.md | https://huggingface.co/docs/transformers/en/model_doc/audio-spectrogram-transformer/#astforaudioclassification | #astforaudioclassification | .md | 225_8 |
<!--Copyright 2022 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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/ | .md | 226_0 | |
The Mask2Former model was proposed in [Masked-attention Mask Transformer for Universal Image Segmentation](https://arxiv.org/abs/2112.01527) by Bowen Cheng, Ishan Misra, Alexander G. Schwing, Alexander Kirillov, Rohit Girdhar. Mask2Former is a unified framework for panoptic, instance and semantic segmentation and featu... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#overview | #overview | .md | 226_1 |
- Mask2Former uses the same preprocessing and postprocessing steps as [MaskFormer](maskformer). Use [`Mask2FormerImageProcessor`] or [`AutoImageProcessor`] to prepare images and optional targets for the model.
- To get the final segmentation, depending on the task, you can call [`~Mask2FormerImageProcessor.post_process... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#usage-tips | #usage-tips | .md | 226_2 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Mask2Former.
- Demo notebooks regarding inference + fine-tuning Mask2Former on custom data can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Mask2Former).
- Scripts for finetuning ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#resources | #resources | .md | 226_3 |
This is the configuration class to store the configuration of a [`Mask2FormerModel`]. It is used to instantiate a
Mask2Former 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 Mask2Former
[facebo... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#mask2formerconfig | #mask2formerconfig | .md | 226_4 |
models.mask2former.modeling_mask2former.Mask2FormerModelOutput
Class for outputs of [`Mask2FormerModel`]. This class returns all the needed hidden states to compute the logits.
Args:
encoder_last_hidden_state (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`, *optional*):
Last hidden states ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#maskformer-specific-outputs | #maskformer-specific-outputs | .md | 226_5 |
The bare Mask2Former Model outputting raw hidden-states without any specific head on top.
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 matter related to general usage and
be... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#mask2formermodel | #mask2formermodel | .md | 226_6 |
The Mask2Former Model with heads on top for instance/semantic/panoptic segmentation.
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 matter related to general usage and
behavio... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#mask2formerforuniversalsegmentation | #mask2formerforuniversalsegmentation | .md | 226_7 |
Constructs a Mask2Former image processor. The image processor can be used to prepare image(s) and optional targets
for the model.
This image processor inherits from [`BaseImageProcessor`] which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.
Arg... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mask2former.md | https://huggingface.co/docs/transformers/en/model_doc/mask2former/#mask2formerimageprocessor | #mask2formerimageprocessor | .md | 226_8 |
<!--Copyright 2023 IBM and HuggingFace Inc. 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 l... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/ | .md | 227_0 | |
The PatchTSMixer model was proposed in [TSMixer: Lightweight MLP-Mixer Model for Multivariate Time Series Forecasting](https://arxiv.org/pdf/2306.09364.pdf) by Vijay Ekambaram, Arindam Jati, Nam Nguyen, Phanwadee Sinthong and Jayant Kalagnanam.
PatchTSMixer is a lightweight time-series modeling approach based on the ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#overview | #overview | .md | 227_1 |
The code snippet below shows how to randomly initialize a PatchTSMixer model. The model is compatible with the [Trainer API](../trainer.md).
```python
from transformers import PatchTSMixerConfig, PatchTSMixerForPrediction
from transformers import Trainer, TrainingArguments,
config = PatchTSMixerConfig(context_leng... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#usage-example | #usage-example | .md | 227_2 |
The model can also be used for time series classification and time series regression. See the respective [`PatchTSMixerForTimeSeriesClassification`] and [`PatchTSMixerForRegression`] classes. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#usage-tips | #usage-tips | .md | 227_3 |
- A blog post explaining PatchTSMixer in depth can be found [here](https://huggingface.co/blog/patchtsmixer). The blog can also be opened in Google Colab. | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#resources | #resources | .md | 227_4 |
This is the configuration class to store the configuration of a [`PatchTSMixerModel`]. It is used to instantiate a
PatchTSMixer 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 PatchTSMixer
[ibm... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#patchtsmixerconfig | #patchtsmixerconfig | .md | 227_5 |
The PatchTSMixer Model for time-series forecasting.
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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#patchtsmixermodel | #patchtsmixermodel | .md | 227_6 |
`PatchTSMixer` for forecasting application.
Args:
config (`PatchTSMixerConfig`):
Configuration.
Returns:
`None`.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#patchtsmixerforprediction | #patchtsmixerforprediction | .md | 227_7 |
`PatchTSMixer` for classification application.
Args:
config (`PatchTSMixerConfig`):
Configuration.
Returns:
`None`.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#patchtsmixerfortimeseriesclassification | #patchtsmixerfortimeseriesclassification | .md | 227_8 |
`PatchTSMixer` for mask pretraining.
Args:
config (`PatchTSMixerConfig`):
Configuration.
Returns:
`None`.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#patchtsmixerforpretraining | #patchtsmixerforpretraining | .md | 227_9 |
`PatchTSMixer` for regression application.
Args:
config (`PatchTSMixerConfig`):
Configuration.
Returns:
`None`.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/patchtsmixer.md | https://huggingface.co/docs/transformers/en/model_doc/patchtsmixer/#patchtsmixerforregression | #patchtsmixerforregression | .md | 227_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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/ | .md | 228_0 | |
The GPTBigCode model was proposed in [SantaCoder: don't reach for the stars!](https://arxiv.org/abs/2301.03988) by BigCode. The listed authors are: Loubna Ben Allal, Raymond Li, Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu, Manan Dey, Logesh Kumar U... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#overview | #overview | .md | 228_1 |
The main differences compared to GPT2.
- Added support for Multi-Query Attention.
- Use `gelu_pytorch_tanh` instead of classic `gelu`.
- Avoid unnecessary synchronizations (this has since been added to GPT2 in #20061, but wasn't in the reference codebase).
- Use Linear layers instead of Conv1D (good speedup but makes t... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#implementation-details | #implementation-details | .md | 228_2 |
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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#combining-starcoder-and-flash-attention-2 | #combining-starcoder-and-flash-attention-2 | .md | 228_3 |
Below is a expected speedup diagram that compares pure inference time between the native implementation in transformers using `bigcode/starcoder` checkpoint and the Flash Attention 2 version of the model using two different sequence lengths.
<div style="text-align: center">
<img src="https://huggingface.co/datasets/y... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#expected-speedups | #expected-speedups | .md | 228_4 |
This is the configuration class to store the configuration of a [`GPTBigCodeModel`]. It is used to instantiate a
GPTBigCode 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 GPTBigCode
[gpt_bigco... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#gptbigcodeconfig | #gptbigcodeconfig | .md | 228_5 |
The bare GPT_BIGCODE Model transformer 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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#gptbigcodemodel | #gptbigcodemodel | .md | 228_6 |
The GPT_BIGCODE Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).
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 th... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#gptbigcodeforcausallm | #gptbigcodeforcausallm | .md | 228_7 |
The GPTBigCode Model transformer with a sequence classification head on top (linear layer).
[`GPTBigCodeForSequenceClassification`] uses the last token in order to do the classification, as other causal
models (e.g. GPT-1) do.
Since it does classification on the last token, it requires to know the position of the l... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#gptbigcodeforsequenceclassification | #gptbigcodeforsequenceclassification | .md | 228_8 |
GPT_BIGCODE Model 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 downlo... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/gpt_bigcode.md | https://huggingface.co/docs/transformers/en/model_doc/gpt_bigcode/#gptbigcodefortokenclassification | #gptbigcodefortokenclassification | .md | 228_9 |
<!--Copyright 2022 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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nystromformer.md | https://huggingface.co/docs/transformers/en/model_doc/nystromformer/ | .md | 229_0 | |
The Nyströmformer model was proposed in [*Nyströmformer: A Nyström-Based Algorithm for Approximating Self-Attention*](https://arxiv.org/abs/2102.03902) by Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn
Fung, Yin Li, and Vikas Singh.
The abstract from the paper is the following:
*Transformer... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nystromformer.md | https://huggingface.co/docs/transformers/en/model_doc/nystromformer/#overview | #overview | .md | 229_1 |
- [Text classification task guide](../tasks/sequence_classification)
- [Token classification task guide](../tasks/token_classification)
- [Question answering task guide](../tasks/question_answering)
- [Masked language modeling task guide](../tasks/masked_language_modeling)
- [Multiple choice task guide](../tasks/multip... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nystromformer.md | https://huggingface.co/docs/transformers/en/model_doc/nystromformer/#resources | #resources | .md | 229_2 |
This is the configuration class to store the configuration of a [`NystromformerModel`]. It is used to instantiate
an Nystromformer 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 Nystromformer
... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nystromformer.md | https://huggingface.co/docs/transformers/en/model_doc/nystromformer/#nystromformerconfig | #nystromformerconfig | .md | 229_3 |
The bare Nyströmformer Model transformer outputting raw hidden-states without any specific head on top.
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 matter related to genera... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nystromformer.md | https://huggingface.co/docs/transformers/en/model_doc/nystromformer/#nystromformermodel | #nystromformermodel | .md | 229_4 |
Nyströmformer Model with a `language modeling` head on top.
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 matter related to general usage and
behavior.
Parameters:
config (... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/nystromformer.md | https://huggingface.co/docs/transformers/en/model_doc/nystromformer/#nystromformerformaskedlm | #nystromformerformaskedlm | .md | 229_5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.