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 |
|---|---|---|---|---|---|
No docstring available for TFViTModel
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/vit.md | https://huggingface.co/docs/transformers/en/model_doc/vit/#tfvitmodel | #tfvitmodel | .md | 140_12 |
No docstring available for TFViTForImageClassification
Methods: call
</tf>
<jax> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/vit.md | https://huggingface.co/docs/transformers/en/model_doc/vit/#tfvitforimageclassification | #tfvitforimageclassification | .md | 140_13 |
No docstring available for FlaxViTModel
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/vit.md | https://huggingface.co/docs/transformers/en/model_doc/vit/#flaxvitmodel | #flaxvitmodel | .md | 140_14 |
No docstring available for FlaxViTForImageClassification
Methods: __call__
</jax>
</frameworkcontent> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/vit.md | https://huggingface.co/docs/transformers/en/model_doc/vit/#flaxvitforimageclassification | #flaxvitforimageclassification | .md | 140_15 |
<!--Copyright 2024 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/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/ | .md | 141_0 | |
Jamba is a state-of-the-art, hybrid SSM-Transformer LLM. It is the first production-scale Mamba implementation, which opens up interesting research and application opportunities. While this initial experimentation shows encouraging gains, we expect these to be further enhanced with future optimizations and explorations... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#overview | #overview | .md | 141_1 |
Jamba is a pretrained, mixture-of-experts (MoE) generative text model, with 12B active parameters and an overall of 52B parameters across all experts. It supports a 256K context length, and can fit up to 140K tokens on a single 80GB GPU.
As depicted in the diagram below, Jamba's architecture features a blocks-and-lay... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#model-details | #model-details | .md | 141_2 |
Jamba requires you use `transformers` version 4.39.0 or higher:
```bash
pip install transformers>=4.39.0
```
In order to run optimized Mamba implementations, you first need to install `mamba-ssm` and `causal-conv1d`:
```bash
pip install mamba-ssm causal-conv1d>=1.2.0
```
You also have to have the model on a CUDA devi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#prerequisites | #prerequisites | .md | 141_3 |
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("ai21labs/Jamba-v0.1")
tokenizer = AutoTokenizer.from_pretrained("ai21labs/Jamba-v0.1")
input_ids = tokenizer("In the recent Super Bowl LVIII,", return_tensors='pt').to(model.device)["input_ids"]
outpu... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#run-the-model | #run-the-model | .md | 141_4 |
This is the configuration class to store the configuration of a [`JambaModel`]. It is used to instantiate a
Jamba 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 Jamba-v0.1 model.
[ai21labs/J... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#jambaconfig | #jambaconfig | .md | 141_5 |
The bare Jamba 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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#jambamodel | #jambamodel | .md | 141_6 |
No docstring available for JambaForCausalLM
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#jambaforcausallm | #jambaforcausallm | .md | 141_7 |
The Jamba Model with a sequence classification head on top (linear layer).
[`JambaForSequenceClassification`] 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_t... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/jamba.md | https://huggingface.co/docs/transformers/en/model_doc/jamba/#jambaforsequenceclassification | #jambaforsequenceclassification | .md | 141_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/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/ | .md | 142_0 | |
The LLaMA model was proposed in [LLaMA: Open and Efficient Foundation Language Models](https://arxiv.org/abs/2302.13971) by Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, E... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#overview | #overview | .md | 142_1 |
- Weights for the LLaMA models can be obtained from by filling out [this form](https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform?usp=send_form)
- After downloading the weights, they will need to be converted to the Hugging Face Transformers format using the [conversion ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#usage-tips | #usage-tips | .md | 142_2 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with LLaMA. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an ex... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#resources | #resources | .md | 142_3 |
This is the configuration class to store the configuration of a [`LlamaModel`]. It is used to instantiate an 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 LLaMA-7B.
Configuration obje... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamaconfig | #llamaconfig | .md | 142_4 |
Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding. The default padding token is unset as there is
no padding token in the original model.
Args:
vocab_file (`str`):
Path to the vocabulary file.
unk_token (`str` or `tokenizers.AddedToken`, *optional*, defaults to `"<unk>"`):
The unknown token. A token... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamatokenizer | #llamatokenizer | .md | 142_5 |
Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding.
This uses notably ByteFallback and no normalization.
```python
>>> from transformers import LlamaTokenizerFast
>>> tokenizer = LlamaTokenizerFast.from_pretrained("hf-internal-testing/llama-tokenizer")
>>> tokenizer.encode("Hello this is a test")
... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamatokenizerfast | #llamatokenizerfast | .md | 142_6 |
The bare 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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamamodel | #llamamodel | .md | 142_7 |
No docstring available for LlamaForCausalLM
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamaforcausallm | #llamaforcausallm | .md | 142_8 |
The LLaMa Model transformer with a sequence classification head on top (linear layer).
[`LlamaForSequenceClassification`] 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.... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamaforsequenceclassification | #llamaforsequenceclassification | .md | 142_9 |
The Llama 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 gener... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamaforquestionanswering | #llamaforquestionanswering | .md | 142_10 |
The Llama 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... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#llamafortokenclassification | #llamafortokenclassification | .md | 142_11 |
No docstring available for FlaxLlamaModel
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#flaxllamamodel | #flaxllamamodel | .md | 142_12 |
No docstring available for FlaxLlamaForCausalLM
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llama.md | https://huggingface.co/docs/transformers/en/model_doc/llama/#flaxllamaforcausallm | #flaxllamaforcausallm | .md | 142_13 |
<!--Copyright 2024 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/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/ | .md | 143_0 | |
The LLaVa-NeXT-Video model was proposed in [LLaVA-NeXT: A Strong Zero-shot Video Understanding Model
](https://llava-vl.github.io/blog/2024-04-30-llava-next-video/) by Yuanhan Zhang, Bo Li, Haotian Liu, Yong Jae Lee, Liangke Gui, Di Fu, Jiashi Feng, Ziwei Liu, Chunyuan Li. LLaVa-NeXT-Video improves upon [LLaVa-NeXT](ll... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#overview | #overview | .md | 143_1 |
- We advise users to use `padding_side="left"` when computing batched generation as it leads to more accurate results. Simply make sure to call `processor.tokenizer.padding_side = "left"` before generating.
<Tip warning={true}>
- Llava-Next uses different number of patches for images and thus has to pad the inputs ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#usage-tips | #usage-tips | .md | 143_2 |
The model can accept both images and videos as input. Here's an example code for inference in half-precision (`torch.float16`):
```python
import av
import torch
import numpy as np
from transformers import LlavaNextVideoForConditionalGeneration, LlavaNextVideoProcessor
def read_video_pyav(container, indices):
'''
Dec... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#single-media-mode | #single-media-mode | .md | 143_3 |
The model can also generate from an interleaved image-video inputs. However note, that it was not trained in interleaved image-video setting which might affect the performance. Below is an example usage for mixed media input, add the following lines to the above code snippet:
```python
from PIL import Image
import re... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#mixed-media-mode | #mixed-media-mode | .md | 143_4 |
The model can be loaded in lower bits, significantly reducing memory burden while maintaining the performance of the original model. This allows for efficient deployment on resource-constrained cases.
First, make sure to install bitsandbytes by running `pip install bitsandbytes` and to have access to a GPU/accelerato... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#quantization-using-bitsandbytes-for-memory-efficiency | #quantization-using-bitsandbytes-for-memory-efficiency | .md | 143_5 |
Additionally, we can greatly speed-up model inference by using [Flash Attention](../perf_train_gpu_one#flash-attention-2), which is a faster implementation of the attention mechanism used inside the model.
First, make sure to install the latest version of Flash Attention 2:
```bash
pip install -U flash-attn --no-bu... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#flash-attention-2-to-speed-up-generation | #flash-attention-2-to-speed-up-generation | .md | 143_6 |
This is the configuration class to store the configuration of a [`LlavaNextVideoForConditionalGeneration`]. It is used to instantiate an
Llava-NeXT model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of t... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#llavanextvideoconfig | #llavanextvideoconfig | .md | 143_7 |
Constructs a LLaVa-NeXT-Video processor which wraps a LLaVa-NeXT image processor, LLaVa-NeXT-Video video processor and
a LLaMa tokenizer into a single processor.
[`LlavaNextVideoProcessor`] offers all the functionalities of [`LlavaNextImageProcessor`], [`LlavaNextVideoImageProcessor`] and
[`LlamaTokenizerFast`]. See ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#llavanextvideoprocessor | #llavanextvideoprocessor | .md | 143_8 |
Constructs a LLaVa-NeXT-Video video processor. Based on [`CLIPImageProcessor`] with incorporation of processing each video frame.
Args:
do_resize (`bool`, *optional*, defaults to `True`):
Whether to resize the image's (height, width) dimensions to the specified `size`. Can be overridden by
`do_resize` in the `preproc... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#llavanextvideoimageprocessor | #llavanextvideoimageprocessor | .md | 143_9 |
The LLAVA-NeXT model which consists of a vision backbone and a language model.
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/llava_next_video.md | https://huggingface.co/docs/transformers/en/model_doc/llava_next_video/#llavanextvideoforconditionalgeneration | #llavanextvideoforconditionalgeneration | .md | 143_10 |
<!--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/xlsr_wav2vec2.md | https://huggingface.co/docs/transformers/en/model_doc/xlsr_wav2vec2/ | .md | 144_0 | |
The XLSR-Wav2Vec2 model was proposed in [Unsupervised Cross-Lingual Representation Learning For Speech Recognition](https://arxiv.org/abs/2006.13979) by Alexis Conneau, Alexei Baevski, Ronan Collobert, Abdelrahman Mohamed, Michael
Auli.
The abstract from the paper is the following:
*This paper presents XLSR which l... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/xlsr_wav2vec2.md | https://huggingface.co/docs/transformers/en/model_doc/xlsr_wav2vec2/#overview | #overview | .md | 144_1 |
- XLSR-Wav2Vec2 is a speech model that accepts a float array corresponding to the raw waveform of the speech signal.
- XLSR-Wav2Vec2 model was trained using connectionist temporal classification (CTC) so the model output has to be
decoded using [`Wav2Vec2CTCTokenizer`].
<Tip>
XLSR-Wav2Vec2's architecture is based o... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/xlsr_wav2vec2.md | https://huggingface.co/docs/transformers/en/model_doc/xlsr_wav2vec2/#usage-tips | #usage-tips | .md | 144_2 |
<!--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/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/ | .md | 145_0 | |
The MVP model was proposed in [MVP: Multi-task Supervised Pre-training for Natural Language Generation](https://arxiv.org/abs/2206.12131) by Tianyi Tang, Junyi Li, Wayne Xin Zhao and Ji-Rong Wen.
According to the abstract,
- MVP follows a standard Transformer encoder-decoder architecture.
- MVP is supervised pre-tr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#overview | #overview | .md | 145_1 |
- We have released a series of models [here](https://huggingface.co/models?filter=mvp), including MVP, MVP with task-specific prompts, and multi-task pre-trained variants.
- If you want to use a model without prompts (standard Transformer), you can load it through `MvpForConditionalGeneration.from_pretrained('RUCAIBox/... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#usage-tips | #usage-tips | .md | 145_2 |
For summarization, it is an example to use MVP and MVP with summarization-specific prompts.
```python
>>> from transformers import MvpTokenizer, MvpForConditionalGeneration
>>> tokenizer = MvpTokenizer.from_pretrained("RUCAIBox/mvp")
>>> model = MvpForConditionalGeneration.from_pretrained("RUCAIBox/mvp")
>>> model_w... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#usage-examples | #usage-examples | .md | 145_3 |
- [Text classification task guide](../tasks/sequence_classification)
- [Question answering task guide](../tasks/question_answering)
- [Causal language modeling task guide](../tasks/language_modeling)
- [Masked language modeling task guide](../tasks/masked_language_modeling)
- [Translation task guide](../tasks/translati... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#resources | #resources | .md | 145_4 |
This is the configuration class to store the configuration of a [`MvpModel`]. It is used to instantiate a MVP 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 MVP [RUCAIBox/mvp](https://huggingf... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvpconfig | #mvpconfig | .md | 145_5 |
Constructs a MVP tokenizer, which is smilar to the RoBERTa tokenizer, using byte-level Byte-Pair-Encoding.
This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will
be encoded differently whether it is at the beginning of the sentence (without space) or not:
... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvptokenizer | #mvptokenizer | .md | 145_6 |
Construct a "fast" MVP tokenizer (backed by HuggingFace's *tokenizers* library), derived from the GPT-2 tokenizer,
using byte-level Byte-Pair-Encoding.
This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will
be encoded differently whether it is at the beginni... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvptokenizerfast | #mvptokenizerfast | .md | 145_7 |
The bare MVP 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 mo... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvpmodel | #mvpmodel | .md | 145_8 |
The MVP Model with a language modeling head. Can be used for various text 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.)... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvpforconditionalgeneration | #mvpforconditionalgeneration | .md | 145_9 |
Mvp model with a sequence classification/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 saving, resizing the input em... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvpforsequenceclassification | #mvpforsequenceclassification | .md | 145_10 |
MVP Model 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 generic methods the
lib... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvpforquestionanswering | #mvpforquestionanswering | .md | 145_11 |
No docstring available for MvpForCausalLM
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mvp.md | https://huggingface.co/docs/transformers/en/model_doc/mvp/#mvpforcausallm | #mvpforcausallm | .md | 145_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 agr... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/ | .md | 146_0 | |
<div class="flex flex-wrap space-x-1">
<a href="https://huggingface.co/models?filter=mbart">
<img alt="Models" src="https://img.shields.io/badge/All_model_pages-mbart-blueviolet">
</a>
<a href="https://huggingface.co/spaces/docs-demos/mbart-large-50-one-to-many-mmt">
<img alt="Spaces" src="https://img.shields.io/badge/... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbart-and-mbart-50 | #mbart-and-mbart-50 | .md | 146_1 |
The MBart model was presented in [Multilingual Denoising Pre-training for Neural Machine Translation](https://arxiv.org/abs/2001.08210) by Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov Marjan
Ghazvininejad, Mike Lewis, Luke Zettlemoyer.
According to the abstract, MBART is a sequence-to-sequence denoising... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#overview-of-mbart | #overview-of-mbart | .md | 146_2 |
MBart is a multilingual encoder-decoder (sequence-to-sequence) model primarily intended for translation task. As the
model is multilingual it expects the sequences in a different format. A special language id token is added in both the
source and target text. The source text format is `X [eos, src_lang_code]` where `X`... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#training-of-mbart | #training-of-mbart | .md | 146_3 |
MBart-50 was introduced in the [Multilingual Translation with Extensible Multilingual Pretraining and Finetuning](https://arxiv.org/abs/2008.00401) paper by Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav
Chaudhary, Jiatao Gu, Angela Fan. MBart-50 is created using the original *mbart-large-cc25* ch... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#overview-of-mbart-50 | #overview-of-mbart-50 | .md | 146_4 |
The text format for MBart-50 is slightly different from mBART. For MBart-50 the language id token is used as a prefix
for both source and target text i.e the text format is `[lang_code] X [eos]`, where `lang_code` is source
language id for source text and target language id for target text, with `X` being the source or... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#training-of-mbart-50 | #training-of-mbart-50 | .md | 146_5 |
- [Text classification task guide](../tasks/sequence_classification)
- [Question answering task guide](../tasks/question_answering)
- [Causal language modeling task guide](../tasks/language_modeling)
- [Masked language modeling task guide](../tasks/masked_language_modeling)
- [Translation task guide](../tasks/translati... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#documentation-resources | #documentation-resources | .md | 146_6 |
This is the configuration class to store the configuration of a [`MBartModel`]. It is used to instantiate an MBART
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 MBART
[facebook/mbart-large-cc... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbartconfig | #mbartconfig | .md | 146_7 |
Construct an MBART tokenizer.
Adapted from [`RobertaTokenizer`] and [`XLNetTokenizer`]. Based on
[SentencePiece](https://github.com/google/sentencepiece).
The tokenization method is `<tokens> <eos> <language code>` for source language documents, and `<language code>
<tokens> <eos>` for target language documents.
... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbarttokenizer | #mbarttokenizer | .md | 146_8 |
Construct a "fast" MBART 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 this sup... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbarttokenizerfast | #mbarttokenizerfast | .md | 146_9 |
Construct a MBart50 tokenizer. Based on [SentencePiece](https://github.com/google/sentencepiece).
This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.
Args:
vocab_file (`str`):
Path to the vo... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbart50tokenizer | #mbart50tokenizer | .md | 146_10 |
Construct a "fast" MBART tokenizer for mBART-50 (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
refe... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbart50tokenizerfast | #mbart50tokenizerfast | .md | 146_11 |
The bare MBART 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 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbartmodel | #mbartmodel | .md | 146_12 |
The MBART Model with a language modeling head. Can be used for summarization, after fine-tuning the pretrained models.
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 embe... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbartforconditionalgeneration | #mbartforconditionalgeneration | .md | 146_13 |
MBART Model 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 generic methods the
l... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbartforquestionanswering | #mbartforquestionanswering | .md | 146_14 |
MBart model with a sequence classification/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 saving, resizing the input ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbartforsequenceclassification | #mbartforsequenceclassification | .md | 146_15 |
No docstring available for MBartForCausalLM
Methods: forward
</pt>
<tf> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#mbartforcausallm | #mbartforcausallm | .md | 146_16 |
No docstring available for TFMBartModel
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#tfmbartmodel | #tfmbartmodel | .md | 146_17 |
No docstring available for TFMBartForConditionalGeneration
Methods: call
</tf>
<jax> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#tfmbartforconditionalgeneration | #tfmbartforconditionalgeneration | .md | 146_18 |
No docstring available for FlaxMBartModel
Methods: __call__
- encode
- decode | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#flaxmbartmodel | #flaxmbartmodel | .md | 146_19 |
No docstring available for FlaxMBartForConditionalGeneration
Methods: __call__
- encode
- decode | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#flaxmbartforconditionalgeneration | #flaxmbartforconditionalgeneration | .md | 146_20 |
No docstring available for FlaxMBartForSequenceClassification
Methods: __call__
- encode
- decode | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#flaxmbartforsequenceclassification | #flaxmbartforsequenceclassification | .md | 146_21 |
No docstring available for FlaxMBartForQuestionAnswering
Methods: __call__
- encode
- decode
</jax>
</frameworkcontent> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/mbart.md | https://huggingface.co/docs/transformers/en/model_doc/mbart/#flaxmbartforquestionanswering | #flaxmbartforquestionanswering | .md | 146_22 |
<!--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/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/ | .md | 147_0 | |
The Whisper model was proposed in [Robust Speech Recognition via Large-Scale Weak Supervision](https://cdn.openai.com/papers/whisper.pdf) by Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, Ilya Sutskever.
The abstract from the paper is the following:
*We study the capabilities of speech proc... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#overview | #overview | .md | 147_1 |
You can run Whisper in less than 4 lines of code and transcribe in less than a minute!
```python
# pip install transformers torch
import torch
from transformers import pipeline
whisper = pipeline("automatic-speech-recognition", "openai/whisper-large-v3", torch_dtype=torch.float16, device="cuda:0")
transcription = ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#quick-usage | #quick-usage | .md | 147_2 |
- The model usually performs well without requiring any finetuning.
- The architecture follows a classic encoder-decoder architecture, which means that it relies on the [`~generation.GenerationMixin.generate`] function for inference.
- One can use [`WhisperProcessor`] to prepare audio for the model, and decode the pred... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#usage-tips | #usage-tips | .md | 147_3 |
Here is a step-by-step guide to transcribing an audio sample using a pre-trained Whisper model:
```python
>>> from datasets import load_dataset
>>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
>>> # Select an audio file and read it:
>>> ds = load_dataset("hf-internal-testing/librispeech... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#inference | #inference | .md | 147_4 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Whisper. If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#resources | #resources | .md | 147_5 |
This is the configuration class to store the configuration of a [`WhisperModel`]. It is used to instantiate a
Whisper 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 Whisper
[openai/whisper-tin... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whisperconfig | #whisperconfig | .md | 147_6 |
Construct a Whisper tokenizer.
This tokenizer inherits from [`PreTrainedTokenizer`] which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.
Args:
vocab_file (`str`):
Path to the vocabulary file.
merges_file (`str`):
Path to the merges file.
normaliz... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whispertokenizer | #whispertokenizer | .md | 147_7 |
Construct a "fast" Whisper tokenizer (backed by HuggingFace's *tokenizers* library).
This tokenizer inherits from [`PreTrainedTokenizerFast`] which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.
Args:
vocab_file (`str`, *optional*):
Path to the... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whispertokenizerfast | #whispertokenizerfast | .md | 147_8 |
Constructs a Whisper 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 mel-filter bank features from ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whisperfeatureextractor | #whisperfeatureextractor | .md | 147_9 |
Constructs a Whisper processor which wraps a Whisper feature extractor and a Whisper tokenizer into a single
processor.
[`WhisperProcessor`] offers all the functionalities of [`WhisperFeatureExtractor`] and [`WhisperTokenizer`]. See
the [`~WhisperProcessor.__call__`] and [`~WhisperProcessor.decode`] for more informat... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whisperprocessor | #whisperprocessor | .md | 147_10 |
The bare Whisper 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.)
Thi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whispermodel | #whispermodel | .md | 147_11 |
The Whisper Model with a language modeling head. Can be used for automatic speech recognition.
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
et... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whisperforconditionalgeneration | #whisperforconditionalgeneration | .md | 147_12 |
Whisper decoder 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 input embeddings... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whisperforcausallm | #whisperforcausallm | .md | 147_13 |
Whisper Encoder Model with a sequence classification head on top (a linear layer over the pooled output) for tasks
like SUPERB Keyword Spotting.
Args:
input_features (`torch.FloatTensor` of shape `(batch_size, feature_size, sequence_length)`):
Float values mel features extracted from the raw speech waveform. Raw spee... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#whisperforaudioclassification | #whisperforaudioclassification | .md | 147_14 |
No docstring available for TFWhisperModel
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#tfwhispermodel | #tfwhispermodel | .md | 147_15 |
No docstring available for TFWhisperForConditionalGeneration
Methods: call
</tf>
<jax> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#tfwhisperforconditionalgeneration | #tfwhisperforconditionalgeneration | .md | 147_16 |
No docstring available for FlaxWhisperModel
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#flaxwhispermodel | #flaxwhispermodel | .md | 147_17 |
No docstring available for FlaxWhisperForConditionalGeneration
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#flaxwhisperforconditionalgeneration | #flaxwhisperforconditionalgeneration | .md | 147_18 |
No docstring available for FlaxWhisperForAudioClassification
Methods: __call__
</jax>
</frameworkcontent> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/whisper.md | https://huggingface.co/docs/transformers/en/model_doc/whisper/#flaxwhisperforaudioclassification | #flaxwhisperforaudioclassification | .md | 147_19 |
<!--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/layoutlmv3.md | https://huggingface.co/docs/transformers/en/model_doc/layoutlmv3/ | .md | 148_0 | |
The LayoutLMv3 model was proposed in [LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking](https://arxiv.org/abs/2204.08387) by Yupan Huang, Tengchao Lv, Lei Cui, Yutong Lu, Furu Wei.
LayoutLMv3 simplifies [LayoutLMv2](layoutlmv2) by using patch embeddings (as in [ViT](vit)) instead of leveragi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/layoutlmv3.md | https://huggingface.co/docs/transformers/en/model_doc/layoutlmv3/#overview | #overview | .md | 148_1 |
- In terms of data processing, LayoutLMv3 is identical to its predecessor [LayoutLMv2](layoutlmv2), except that:
- images need to be resized and normalized with channels in regular RGB format. LayoutLMv2 on the other hand normalizes the images internally and expects the channels in BGR format.
- text is tokenized using... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/layoutlmv3.md | https://huggingface.co/docs/transformers/en/model_doc/layoutlmv3/#usage-tips | #usage-tips | .md | 148_2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.