text stringlengths 5 58.6k | source stringclasses 470
values | url stringlengths 49 167 | source_section stringlengths 0 90 | file_type stringclasses 1
value | id stringlengths 3 6 |
|---|---|---|---|---|---|
The vision model from CLIP without any head or projection 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 Py... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#clipvisionmodel | #clipvisionmodel | .md | 254_22 |
CLIP vision encoder with an image classification head on top (a linear layer on top of the pooled final hidden states of
the patch tokens) e.g. for ImageNet.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downl... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#clipforimageclassification | #clipforimageclassification | .md | 254_23 |
No docstring available for TFCLIPModel
Methods: call
- get_text_features
- get_image_features | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#tfclipmodel | #tfclipmodel | .md | 254_24 |
No docstring available for TFCLIPTextModel
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#tfcliptextmodel | #tfcliptextmodel | .md | 254_25 |
No docstring available for TFCLIPVisionModel
Methods: call
</tf>
<jax> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#tfclipvisionmodel | #tfclipvisionmodel | .md | 254_26 |
No docstring available for FlaxCLIPModel
Methods: __call__
- get_text_features
- get_image_features | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#flaxclipmodel | #flaxclipmodel | .md | 254_27 |
No docstring available for FlaxCLIPTextModel
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#flaxcliptextmodel | #flaxcliptextmodel | .md | 254_28 |
No docstring available for FlaxCLIPTextModelWithProjection
Methods: __call__ | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#flaxcliptextmodelwithprojection | #flaxcliptextmodelwithprojection | .md | 254_29 |
No docstring available for FlaxCLIPVisionModel
Methods: __call__
</jax>
</frameworkcontent> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/clip.md | https://huggingface.co/docs/transformers/en/model_doc/clip/#flaxclipvisionmodel | #flaxclipvisionmodel | .md | 254_30 |
<!--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/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/ | .md | 255_0 | |
The TextNet model was proposed in [FAST: Faster Arbitrarily-Shaped Text Detector with Minimalist Kernel Representation](https://arxiv.org/abs/2111.02394) by Zhe Chen, Jiahao Wang, Wenhai Wang, Guo Chen, Enze Xie, Ping Luo, Tong Lu. TextNet is a vision backbone useful for text detection tasks. It is the result of neural... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/#overview | #overview | .md | 255_1 |
TextNet is mainly used as a backbone network for the architecture search of text detection. Each stage of the backbone network is comprised of a stride-2 convolution and searchable blocks.
Specifically, we present a layer-level candidate set, defined as {conv3×3, conv1×3, conv3×1, identity}. As the 1×3 and 3×1 convolut... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/#usage-tips | #usage-tips | .md | 255_2 |
This is the configuration class to store the configuration of a [`TextNextModel`]. It is used to instantiate a
TextNext 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
[czczup/textnet-base](htt... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/#textnetconfig | #textnetconfig | .md | 255_3 |
Constructs a TextNet image processor.
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 `preprocess` method.
size (`Dict[str, int]` *optional*, defaults to `{"shortest_edge": 640}`):
Size ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/#textnetimageprocessor | #textnetimageprocessor | .md | 255_4 |
The bare Textnet model outputting raw features 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
behavior.
... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/#textnetmodel | #textnetmodel | .md | 255_5 |
TextNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.
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 matte... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/textnet.md | https://huggingface.co/docs/transformers/en/model_doc/textnet/#textnetforimageclassification | #textnetforimageclassification | .md | 255_6 |
<!--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/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/ | .md | 256_0 | |
The RT-DETR model was proposed in [DETRs Beat YOLOs on Real-time Object Detection](https://arxiv.org/abs/2304.08069) by Wenyu Lv, Yian Zhao, Shangliang Xu, Jinman Wei, Guanzhong Wang, Cheng Cui, Yuning Du, Qingqing Dang, Yi Liu.
RT-DETR is an object detection model that stands for "Real-Time DEtection Transformer." T... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#overview | #overview | .md | 256_1 |
Initially, an image is processed using a pre-trained convolutional neural network, specifically a Resnet-D variant as referenced in the original code. This network extracts features from the final three layers of the architecture. Following this, a hybrid encoder is employed to convert the multi-scale features into a s... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#usage-tips | #usage-tips | .md | 256_2 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with RT-DETR.
<PipelineTag pipeline="object-detection"/>
- Scripts for finetuning [`RTDetrForObjectDetection`] with [`Trainer`] or [Accelerate](https://huggingface.co/docs/accelerate/index) can be found [here](https://... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#resources | #resources | .md | 256_3 |
This is the configuration class to store the configuration of a [`RTDetrModel`]. It is used to instantiate a
RT-DETR 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 RT-DETR
[checkpoing/todo](ht... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrconfig | #rtdetrconfig | .md | 256_4 |
This is the configuration class to store the configuration of a [`RTDetrResnetBackbone`]. It is used to instantiate an
ResNet 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 ResNet
[microsoft/r... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrresnetconfig | #rtdetrresnetconfig | .md | 256_5 |
Constructs a RT-DETR image processor.
Args:
format (`str`, *optional*, defaults to `AnnotationFormat.COCO_DETECTION`):
Data format of the annotations. One of "coco_detection" or "coco_panoptic".
do_resize (`bool`, *optional*, defaults to `True`):
Controls whether to resize the image's (height, width) dimensions to th... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrimageprocessor | #rtdetrimageprocessor | .md | 256_6 |
Constructs a fast RTDetr image processor.
Args:
format (`str`, *optional*, defaults to `AnnotationFormat.COCO_DETECTION`):
Data format of the annotations. One of "coco_detection" or "coco_panoptic".
do_resize (`bool`, *optional*, defaults to `True`):
Controls whether to resize the image's `(height, width)` dimensions... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrimageprocessorfast | #rtdetrimageprocessorfast | .md | 256_7 |
RT-DETR Model (consisting of a backbone and encoder-decoder) outputting raw hidden states without any 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 embedd... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrmodel | #rtdetrmodel | .md | 256_8 |
RT-DETR Model (consisting of a backbone and encoder-decoder) outputting bounding boxes and logits to be further
decoded into scores and classes.
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or sav... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrforobjectdetection | #rtdetrforobjectdetection | .md | 256_9 |
ResNet backbone, to be used with frameworks like RTDETR.
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
behavior.
Parameters:
config ([`... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/rt_detr.md | https://huggingface.co/docs/transformers/en/model_doc/rt_detr/#rtdetrresnetbackbone | #rtdetrresnetbackbone | .md | 256_10 |
<!--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/falcon3.md | https://huggingface.co/docs/transformers/en/model_doc/falcon3/ | .md | 257_0 | |
Falcon3 represents a natural evolution from previous releases, emphasizing expanding the models' science, math, and code capabilities. This iteration includes five base models: Falcon3-1B-Base, Falcon3-3B-Base, Falcon3-Mamba-7B-Base, Falcon3-7B-Base, and Falcon3-10B-Base. In developing these models, we incorporated sev... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/falcon3.md | https://huggingface.co/docs/transformers/en/model_doc/falcon3/#overview | #overview | .md | 257_1 |
- [Blog post](https://huggingface.co/blog/falcon3)
- [Models on Huggingface](https://huggingface.co/collections/tiiuae/falcon3-67605ae03578be86e4e87026) | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/falcon3.md | https://huggingface.co/docs/transformers/en/model_doc/falcon3/#resources | #resources | .md | 257_2 |
<!--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/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/ | .md | 258_0 | |
The Idefics2 model was proposed in [What matters when building vision-language models?](https://arxiv.org/abs/2405.02246) by Léo Tronchon, Hugo Laurencon, Victor Sanh. The accompanying blog post can be found [here](https://huggingface.co/blog/idefics2).
Idefics2 is an open multimodal model that accepts arbitrary sequ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#overview | #overview | .md | 258_1 |
- Each sample can contain multiple images, and the number of images can vary between samples. The processor will pad the inputs to the maximum number of images in a batch for input to the model.
- The processor has a `do_image_splitting` option. If `True`, each input image will be split into 4 sub-images, and concatena... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#usage-tips | #usage-tips | .md | 258_2 |
The code snippets above showcase inference without any optimization tricks. However, one can drastically speed up the model by leveraging [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 lates... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#model-optimizations-flash-attention | #model-optimizations-flash-attention | .md | 258_3 |
As the Idefics2 model has 8 billion parameters, that would require about 16GB of GPU RAM in half precision (float16), since each parameter is stored in 2 bytes. However, one can shrink down the size of the model using [quantization](../quantization.md). If the model is quantized to 4 bits (or half a byte per parameter)... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#shrinking-down-idefics2-using-quantization | #shrinking-down-idefics2-using-quantization | .md | 258_4 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Idefics2. 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/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#resources | #resources | .md | 258_5 |
This is the configuration class to store the configuration of a [`Idefics2Model`]. It is used to instantiate a
Idefics2 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 model of the Idefics2
[Hu... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#idefics2config | #idefics2config | .md | 258_6 |
Idefics2 model consisting of a SIGLIP vision encoder and Mistral language decoder
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/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#idefics2model | #idefics2model | .md | 258_7 |
The Idefics2 Model with a language modeling head. It is made up a SigLIP vision encoder, 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 in... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/idefics2.md | https://huggingface.co/docs/transformers/en/model_doc/idefics2/#idefics2forconditionalgeneration | #idefics2forconditionalgeneration | .md | 258_8 |
<!--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/informer.md | https://huggingface.co/docs/transformers/en/model_doc/informer/ | .md | 259_0 | |
The Informer model was proposed in [Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting](https://arxiv.org/abs/2012.07436) by Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang.
This method introduces a Probabilistic Attention mechanism to select... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/informer.md | https://huggingface.co/docs/transformers/en/model_doc/informer/#overview | #overview | .md | 259_1 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started. 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 existing reso... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/informer.md | https://huggingface.co/docs/transformers/en/model_doc/informer/#resources | #resources | .md | 259_2 |
This is the configuration class to store the configuration of an [`InformerModel`]. It is used to instantiate an
Informer 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 Informer
[huggingface/i... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/informer.md | https://huggingface.co/docs/transformers/en/model_doc/informer/#informerconfig | #informerconfig | .md | 259_3 |
The bare Informer 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/informer.md | https://huggingface.co/docs/transformers/en/model_doc/informer/#informermodel | #informermodel | .md | 259_4 |
The Informer Model with a distribution head on top 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 mode... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/informer.md | https://huggingface.co/docs/transformers/en/model_doc/informer/#informerforprediction | #informerforprediction | .md | 259_5 |
<!--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/herbert.md | https://huggingface.co/docs/transformers/en/model_doc/herbert/ | .md | 260_0 | |
The HerBERT model was proposed in [KLEJ: Comprehensive Benchmark for Polish Language Understanding](https://www.aclweb.org/anthology/2020.acl-main.111.pdf) by Piotr Rybak, Robert Mroczkowski, Janusz Tracz, and
Ireneusz Gawlik. It is a BERT-based Language Model trained on Polish Corpora using only MLM objective with dyn... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/herbert.md | https://huggingface.co/docs/transformers/en/model_doc/herbert/#overview | #overview | .md | 260_1 |
```python
>>> from transformers import HerbertTokenizer, RobertaModel
>>> tokenizer = HerbertTokenizer.from_pretrained("allegro/herbert-klej-cased-tokenizer-v1")
>>> model = RobertaModel.from_pretrained("allegro/herbert-klej-cased-v1")
>>> encoded_input = tokenizer.encode("Kto ma lepszą sztukę, ma lepszy rząd – to ja... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/herbert.md | https://huggingface.co/docs/transformers/en/model_doc/herbert/#usage-example | #usage-example | .md | 260_2 |
Construct a BPE tokenizer for HerBERT.
Peculiarities:
- uses BERT's pre-tokenizer: BaseTokenizer splits tokens on spaces, and also on punctuation. Each occurrence of a
punctuation character will be treated separately.
- Such pretokenized input is BPE subtokenized
This tokenizer inherits from [`XLMTokenizer`] wh... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/herbert.md | https://huggingface.co/docs/transformers/en/model_doc/herbert/#herberttokenizer | #herberttokenizer | .md | 260_3 |
Construct a "Fast" BPE tokenizer for HerBERT (backed by HuggingFace's *tokenizers* library).
Peculiarities:
- uses BERT's pre-tokenizer: BertPreTokenizer splits tokens on spaces, and also on punctuation. Each occurrence of
a punctuation character will be treated separately.
This tokenizer inherits from [`PreTrain... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/herbert.md | https://huggingface.co/docs/transformers/en/model_doc/herbert/#herberttokenizerfast | #herberttokenizerfast | .md | 260_4 |
<!--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/encodec.md | https://huggingface.co/docs/transformers/en/model_doc/encodec/ | .md | 261_0 | |
The EnCodec neural codec model was proposed in [High Fidelity Neural Audio Compression](https://arxiv.org/abs/2210.13438) by Alexandre Défossez, Jade Copet, Gabriel Synnaeve, Yossi Adi.
The abstract from the paper is the following:
*We introduce a state-of-the-art real-time, high-fidelity, audio codec leveraging ne... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/encodec.md | https://huggingface.co/docs/transformers/en/model_doc/encodec/#overview | #overview | .md | 261_1 |
Here is a quick example of how to encode and decode an audio using this model:
```python
>>> from datasets import load_dataset, Audio
>>> from transformers import EncodecModel, AutoProcessor
>>> librispeech_dummy = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
>>> model = Enc... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/encodec.md | https://huggingface.co/docs/transformers/en/model_doc/encodec/#usage-example | #usage-example | .md | 261_2 |
This is the configuration class to store the configuration of an [`EncodecModel`]. It is used to instantiate a
Encodec 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
[facebook/encodec_24khz](h... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/encodec.md | https://huggingface.co/docs/transformers/en/model_doc/encodec/#encodecconfig | #encodecconfig | .md | 261_3 |
Constructs an EnCodec 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.
Instantiating a feature extractor with the defaul... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/encodec.md | https://huggingface.co/docs/transformers/en/model_doc/encodec/#encodecfeatureextractor | #encodecfeatureextractor | .md | 261_4 |
The EnCodec neural audio codec 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 is also a PyTorch [torch.nn.Module](http... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/encodec.md | https://huggingface.co/docs/transformers/en/model_doc/encodec/#encodecmodel | #encodecmodel | .md | 261_5 |
<!--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/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/ | .md | 262_0 | |
The BLIP-2 model was proposed in [BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models](https://arxiv.org/abs/2301.12597) by
Junnan Li, Dongxu Li, Silvio Savarese, Steven Hoi. BLIP-2 leverages frozen pre-trained image encoders and large language models (LLMs) by trainin... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#overview | #overview | .md | 262_1 |
- BLIP-2 can be used for conditional text generation given an image and an optional text prompt. At inference time, it's recommended to use the [`generate`] method.
- One can use [`Blip2Processor`] to prepare images for the model, and decode the predicted tokens ID's back to text.
> [!NOTE]
> BLIP models after releas... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#usage-tips | #usage-tips | .md | 262_2 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with BLIP-2.
- Demo notebooks for BLIP-2 for image captioning, visual question answering (VQA) and chat-like conversations can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/BLIP-2).
I... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#resources | #resources | .md | 262_3 |
[`Blip2Config`] is the configuration class to store the configuration of a [`Blip2ForConditionalGeneration`]. It is
used to instantiate a BLIP-2 model according to the specified arguments, defining the vision model, Q-Former model
and language model configs. Instantiating a configuration with the defaults will yield a ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2config | #blip2config | .md | 262_4 |
This is the configuration class to store the configuration of a [`Blip2VisionModel`]. It is used to instantiate a
BLIP-2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration defaults will yield a similar configuration to that of the BLIP-2
[Salesforce/blip2... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2visionconfig | #blip2visionconfig | .md | 262_5 |
This is the configuration class to store the configuration of a [`Blip2QFormerModel`]. It is used to instantiate a
BLIP-2 Querying Transformer (Q-Former) model according to the specified arguments, defining the model architecture.
Instantiating a configuration with the defaults will yield a similar configuration to tha... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2qformerconfig | #blip2qformerconfig | .md | 262_6 |
Constructs a BLIP-2 processor which wraps a BLIP image processor and an OPT/T5 tokenizer into a single processor.
[`BlipProcessor`] offers all the functionalities of [`BlipImageProcessor`] and [`AutoTokenizer`]. See the docstring
of [`~BlipProcessor.__call__`] and [`~BlipProcessor.decode`] for more information.
Arg... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2processor | #blip2processor | .md | 262_7 |
No docstring available for Blip2VisionModel
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2visionmodel | #blip2visionmodel | .md | 262_8 |
Querying Transformer (Q-Former), used in BLIP-2.
Methods: forward | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2qformermodel | #blip2qformermodel | .md | 262_9 |
BLIP-2 Model for generating text and image features. The model consists of a vision encoder, Querying Transformer
(Q-Former) 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 s... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2model | #blip2model | .md | 262_10 |
BLIP-2 Model for generating text given an image and an optional text prompt. The model consists of a vision
encoder, Querying Transformer (Q-Former) and a language model.
One can optionally pass `input_ids` to the model, which serve as a text prompt, to make the language model continue
the prompt. Otherwise, the lang... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2forconditionalgeneration | #blip2forconditionalgeneration | .md | 262_11 |
BLIP-2 Model with a vision and text projector, and a classification head on top. The model is used in the context
of image-text retrieval. Given an image and a text, the model returns the probability of the text being relevant to
the image.
This model inherits from [`PreTrainedModel`]. Check the superclass documentat... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2forimagetextretrieval | #blip2forimagetextretrieval | .md | 262_12 |
BLIP-2 Text Model with a projection layer on top (a linear layer on top of the pooled output).
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/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2textmodelwithprojection | #blip2textmodelwithprojection | .md | 262_13 |
BLIP-2 Vision Model with a projection layer on top (a linear layer on top of the pooled output).
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 head... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/blip-2.md | https://huggingface.co/docs/transformers/en/model_doc/blip-2/#blip2visionmodelwithprojection | #blip2visionmodelwithprojection | .md | 262_14 |
<!--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/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/ | .md | 263_0 | |
<div class="flex flex-wrap space-x-1">
<a href="https://huggingface.co/models?filter=bert">
<img alt="Models" src="https://img.shields.io/badge/All_model_pages-bert-blueviolet">
</a>
<a href="https://huggingface.co/spaces/docs-demos/bert-base-uncased">
<img alt="Spaces" src="https://img.shields.io/badge/%F0%9F%A4%97%20... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bert | #bert | .md | 263_1 |
The BERT model was proposed in [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. It's a
bidirectional transformer pretrained using a combination of masked language modeling objective an... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#overview | #overview | .md | 263_2 |
- BERT is a model with absolute position embeddings so it's usually advised to pad the inputs on the right rather than
the left.
- BERT was trained with the masked language modeling (MLM) and next sentence prediction (NSP) objectives. It is
efficient at predicting masked tokens and at NLU in general, but is not optimal... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#usage-tips | #usage-tips | .md | 263_3 |
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/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#using-scaled-dot-product-attention-sdpa | #using-scaled-dot-product-attention-sdpa | .md | 263_4 |
|batch_size|seq_len|Time per batch (eager - s)|Time per batch (sdpa - s)|Speedup (%)|Eager peak mem (MB)|sdpa peak mem (MB)|Mem saving (%)|
|----------|-------|--------------------------|-------------------------|-----------|-------------------|------------------|--------------|
|4 |256 |0.023 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#training | #training | .md | 263_5 |
|batch_size|seq_len|Per token latency eager (ms)|Per token latency SDPA (ms)|Speedup (%)|Mem eager (MB)|Mem BT (MB)|Mem saved (%)|
|----------|-------|----------------------------|---------------------------|-----------|--------------|-----------|-------------|
|1 |128 |5.736 |4.987 ... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#inference | #inference | .md | 263_6 |
A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with BERT. 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 exi... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#resources | #resources | .md | 263_7 |
This is the configuration class to store the configuration of a [`BertModel`] or a [`TFBertModel`]. It is used to
instantiate a BERT 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 BERT
[google... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertconfig | #bertconfig | .md | 263_8 |
Construct a BERT tokenizer. Based on WordPiece.
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`):
File containing the vocabulary.
do_lower_case (`bool`, *optional... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#berttokenizer | #berttokenizer | .md | 263_9 |
Construct a "fast" BERT tokenizer (backed by HuggingFace's *tokenizers* library). Based on WordPiece.
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`):
File c... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#berttokenizerfast | #berttokenizerfast | .md | 263_10 |
No docstring available for TFBertTokenizer
</tf>
</frameworkcontent> | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfberttokenizer | #tfberttokenizer | .md | 263_11 |
models.bert.modeling_bert.BertForPreTrainingOutput
Output type of [`BertForPreTraining`].
Args:
loss (*optional*, returned when `labels` is provided, `torch.FloatTensor` of shape `(1,)`):
Total loss as the sum of the masked language modeling loss and the next sequence prediction
(classification) loss.
prediction_lo... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bert-specific-outputs | #bert-specific-outputs | .md | 263_12 |
The bare Bert 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/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertmodel | #bertmodel | .md | 263_13 |
Bert 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 download... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertforpretraining | #bertforpretraining | .md | 263_14 |
Bert Model with a `language modeling` head on top for CLM fine-tuning.
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 al... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertlmheadmodel | #bertlmheadmodel | .md | 263_15 |
Bert 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/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertformaskedlm | #bertformaskedlm | .md | 263_16 |
Bert 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 i... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertfornextsentenceprediction | #bertfornextsentenceprediction | .md | 263_17 |
Bert 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 savin... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertforsequenceclassification | #bertforsequenceclassification | .md | 263_18 |
Bert 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 downloading... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertformultiplechoice | #bertformultiplechoice | .md | 263_19 |
Bert 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 o... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertfortokenclassification | #bertfortokenclassification | .md | 263_20 |
Bert 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
l... | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#bertforquestionanswering | #bertforquestionanswering | .md | 263_21 |
No docstring available for TFBertModel
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertmodel | #tfbertmodel | .md | 263_22 |
No docstring available for TFBertForPreTraining
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertforpretraining | #tfbertforpretraining | .md | 263_23 |
No docstring available for TFBertLMHeadModel
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertmodellmheadmodel | #tfbertmodellmheadmodel | .md | 263_24 |
No docstring available for TFBertForMaskedLM
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertformaskedlm | #tfbertformaskedlm | .md | 263_25 |
No docstring available for TFBertForNextSentencePrediction
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertfornextsentenceprediction | #tfbertfornextsentenceprediction | .md | 263_26 |
No docstring available for TFBertForSequenceClassification
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertforsequenceclassification | #tfbertforsequenceclassification | .md | 263_27 |
No docstring available for TFBertForMultipleChoice
Methods: call | /Users/nielsrogge/Documents/python_projecten/transformers/docs/source/en/model_doc/bert.md | https://huggingface.co/docs/transformers/en/model_doc/bert/#tfbertformultiplechoice | #tfbertformultiplechoice | .md | 263_28 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.