NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #269 most downloaded on PyPI
Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Latest stable
5.23.0
Last release 5 days ago
13 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
6 versions withdrawn
withdrawn after publishing
10 years old
253 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
These are not breaking changes per se but rather bugfixes. However, we understand that this may result in some workflow changes so we highlight them b…
Mistral-7B-v0.1 is a decoder-based LM with the following architectural choices:
The authors introduced Persimmon-8B, a decoder model based on the classic transformers architecture, with query and key normalization. Persimmon-8B is a fully permissively licensed model with approximately 8 billion parameters, released under the Apache license. Some of the key attributes of Persimmon-8B are long context size (16K), performance, and capabilities for multimodal extensions.
Persimmon] Add support for persimmon by @ArthurZucker in #26042BROS stands for BERT Relying On Spatiality. It is an encoder-only Transformer model that takes a sequence of tokens and their bounding boxes as inputs and outputs a sequence of hidden states. BROS encode relative spatial information instead of using absolute spatial information.
ViTMatte leverages plain Vision Transformers for the task of image matting, which is the process of accurately estimating the foreground object in images and videos.
Nougat uses the same architecture as Donut, meaning an image Transformer encoder and an autoregressive text Transformer decoder to translate scientific PDFs to markdown, enabling easier access to them.
We've added a new template feature for chat models. This allows the formatting that a chat model was trained with to be saved with the model, ensuring that users can exactly reproduce that formatting when they want to fine-tune the model or use it for inference. For more information, see our template documentation.
Tokenizer] attemp to fix add_token issues by @ArthurZucker in #23909🚨Workflow Changes 🚨:
These are not breaking changes per se but rather bugfixes. However, we understand that this may result in some workflow changes so we highlight them below.
➕ Most visible features:
tokenizer.added_tokens_decoder for both fast and slow tokenizers. Moreover, additional tokens that were already part of the initial vocab are also found there.from_pretrained, faster add_tokens because special and non special can be mixed together and the trie is not always rebuilt.added_tokens_decoder/encoder.tokenizer_config.jsonFor any issues relating to this, make sure to open a new issue and ping @ArthurZucker.
FA2 support added to transformers for most popular architectures (llama, mistral, falcon) architectures actively being contributed in this issue (https://github.com/huggingface/transformers/issues/26350). Simply pass use_flash_attention_2=True when calling from_pretrained
In the future, PyTorch will support Flash Attention 2 through torch.scaled_dot_product_attention, users would be able to benefit from both (transformers core & transformers + SDPA) implementations of Flash Attention-2 with simple changes (model.to_bettertransformer() and force-dispatch the SDPA kernel to FA-2 in the case of SDPA)
core ] Integrate Flash attention 2 in most used models by @younesbelkada in #25598For our future plans regarding integrating F.sdpa from PyTorch in core transformers, see here: https://github.com/huggingface/transformers/issues/26557
Support for lazy loading integration libraries has been added. This will drastically speed up importing transformers and related object from the library.
Example before this change:
2023-09-11 11:07:52.010179: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
python3 -c "from transformers import CLIPTextModel" 3.31s user 3.06s system 220% cpu 2.893 total
After this change:
python3 -c "from transformers import CLIPTextModel" 1.70s user 1.49s system 220% cpu 1.447 total
test_load_img_url_timeout by @ydshieh in #25976Pop2Piano space demo. by @susnato in #25975generation_config by @gante in #25987CI] Fix red CI and ERROR failed should show by @ArthurZucker in #25995VITS] tokenizer integration test: fix revision did not exist by @ArthurZucker in #25996llm_tutorial.md to Korean by @harheem in #25791tgs speed metrics by @CokeDong in #25858activation_dropout and fix DropOut docs for SEW-D by @gau-nernst in #26031llama.md to Korean by @harheem in #26044CodeLlamaTokenizerFast] Fix fix set_infilling_processor to properly reset by @ArthurZucker in #26041CITests] skip failing tests until #26054 is merged by @ArthurZucker in #26063core] Import tensorflow inside relevant methods in trainer_utils by @younesbelkada in #26106generation_config is untouched by @gante in #25962llama2.md to Korean by @mjk0618 in #26047contributing.md to Korean by @mjk0618 in #25877MarianTokenizer to remove metaspace character in decode by @tanaymeh in #26091core] fix 4bit num_parameters by @younesbelkada in #26132RWKV] Final fix RWMV 4bit by @younesbelkada in #26134generation_config.max_length is set to None by @gante in #26147test_finetune_bert2bert by @ydshieh in #25984beam_scores shape when token scores shape changes after logits_processor by @BakerBunker in #25980accelerate > 0.20.3 by @sam-scale in #26060PEFT] Fix PEFT + gradient checkpointing by @younesbelkada in #25846convert_bros_to_pytorch.py by @ydshieh in #26212utils/documentation_tests.txt by @ydshieh in #26213ctrl to Salesforce/ctrl by @julien-c in #26183whisper.md to Korean by @nuatmochoi in #26002Error not captured in PR doctesting by @ydshieh in #26215Trainer] Refactor trainer + bnb logic by @younesbelkada in #26248ALL_LAYERNORM_LAYERS by @shijie-wu in #26227model._keep_in_fp32_modules is set even when accelerate is not installed by @fxmarty in #26225store_test_results by @ydshieh in #26223audio_classification.mdx to Korean by @gabrielwithappy in #26200RMSProp optimizer by @natolambert in #26425transformers is installed without tokenizers by @urialon in #26236FA / tests] Add use_cache tests for FA models by @younesbelkada in #26415PEFT] Fix PEFT multi adapters support by @younesbelkada in #26407runs-on in workflow files by @ydshieh in #26435debugging.md to Korean by @wonhyeongseo in #26246perf_train_gpu_many.md to Korean by @wonhyeongseo in #26244cos_sin device issue in Falcon model by @ydshieh in #26448PEFT] introducing adapter_kwargs for loading adapters from different Hub location (subfolder, revision) than the base model by @younesbelkada in #26270PEFT] Pass token when calling find_adapter_config by @younesbelkada in #26488core/ auto ] Fix bnb test with code revision + bug with code revision by @younesbelkada in #26431PEFT] Protect adapter_kwargs check by @younesbelkada in #26537tokenizer_summary.md to Korean by @wonhyeongseo in #26243configuration_encoder_decoder.py by @SrijanSahaySrivastava in #26519The following contributors have made significant changes to the library over the last release:
debugging.md to Korean (#26246)perf_train_gpu_many.md to Korean (#26244)tokenizer_summary.md to Korean (#26243)Your coding agent can read these notes before it upgrades. Set up the MCP server →
A patch release was made for the following three commits:
A patch release was made for the following three commits:
A patch release was done for these two commits:
A patch release was done for these two commits:
[VITS] Handle deprecated weight norm by @sanchit-gandhi in #25946
Falcon is a class of causal decoder-only models built by TII. The largest Falcon checkpoints have been trained on >=1T tokens of text, with a particular emphasis on the RefinedWeb corpus. They are made available under the Apache 2.0 license.
Falcon’s architecture is modern and optimized for inference, with multi-query attention and support for efficient attention variants like FlashAttention. Both ‘base’ models trained only as causal language models as well as ‘instruct’ models that have received further fine-tuning are available.
Falcon] Remove SDPA for falcon to support earlier versions of PyTorch (< 2.0) by @younesbelkada in #25947Code Llama, is a family of large language models for code based on Llama 2, providing state-of-the-art performance among open models, infilling capabilities, support for large input contexts, and zero-shot instruction following ability for programming tasks.
CodeLlama] Add support for CodeLlama by @ArthurZucker in #25740CodeLlama] Fix CI by @ArthurZucker in #25890ViTDet reuses the ViT model architecture, adapted to object detection.
DINO v2 is the next iteration of the DINO model. It is added as a backbone class, allowing it to be re-used in downstream models.
VITS (Variational Inference with adversarial learning for end-to-end Text-to-Speech) is an end-to-end speech synthesis model that predicts a speech waveform conditional on an input text sequence. It is a conditional variational autoencoder (VAE) comprised of a posterior encoder, decoder, and conditional prior.
Refactor] Move third-party related utility files into integrations/ folder 🚨🚨🚨 by @younesbelkada in #25599Moves all third party libs (outside HF ecosystem) related utility files inside integrations/ instead of having them in transformers directly.
In order to get the previous usage you should be changing your call to the following:
- from transformers.deepspeed import HfDeepSpeedConfig
+ from transformers.integrations import HfDeepSpeedConfig
TRANSFORMERS_TEST_BACKEND by @vvvm23 in #25655SPM] Patch spm Llama and T5 by @ArthurZucker in #25656GPTNeo] Add input_embeds functionality to gpt_neo Causal LM by @ArthurZucker in #25664utils/documentation_tests.txt by @ydshieh in #25680pad_token check condition by @ydshieh in #25685inputs_embeds by @gante in #25687configuration_gpt2.py by @susnato in #25676LlamaTokenizer] make unk_token_length a property by @ArthurZucker in #25689test_batch_generation for bloom by @ydshieh in #25718PEFT] Fix peft version by @younesbelkada in #25710AutoGPTQ] Add correct installation of GPTQ library + fix slow tests by @younesbelkada in #25713do_sample=False when temperature=0.0 by @gante in #25722from_pretrained] Simpler code for peft by @ArthurZucker in #25726from_pretrained] Fix failing PEFT tests by @younesbelkada in #25733visual_question_answering.md to Korean by @wonhyeongseo in #25679PEFT] Fix PeftConfig save pretrained when calling add_adapter by @younesbelkada in #25738Sentencepiece] make sure legacy do not require protobuf by @ArthurZucker in #25684HammingDiversityLogitsProcessor by @gante in #25756LlamaFamiliy] add a tip about dtype by @ArthurZucker in #25794hidden_act by @stas00 in #25787Docs] More clarifications on BT + FA by @younesbelkada in #25823LlamaTokenizer] tokenize nits. by @ArthurZucker in #25793model_memory_anatomy.md to Korean by @mjk0618 in #25755add_new_pipeline.md to Korean by @heuristicwave in #25498community.md to Korean by @sim-so in #25674Pop2Piano checkpoints by @susnato in #25827generate() return True in can_generate() by @gante in #25838generation_strategies.md by @gante in #25874stage3_gather_16bit_weights_on_model_save=False by @pacman100 in #25817TokenizerFast] can_save_slow_tokenizer as a property for when vocab_file's folder was removed by @ArthurZucker in #25626InstructBlip] FINAL Fix instructblip test by @younesbelkada in #25887setup.py by @ydshieh in #25893is_tensor by @sgugger in #25871ViTDet by @ydshieh in #25913The following contributors have made significant changes to the library over the last release:
Nothing published for this version
Patch release including several patches from v4.31.0, listed below:
Patch release including several patches from v4.31.0, listed below:
We continue the deprecation of models that was introduced in https://github.com/huggingface/transformers/pull/24787.
The IDEFICS model was proposed in OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents by Hugo Laurençon, Lucile Saulnier, Léo Tronchon, Stas Bekman, Amanpreet Singh, Anton Lozhkov, Thomas Wang, Siddharth Karamcheti, Alexander M. Rush, Douwe Kiela, Matthieu Cord, Victor Sanh
IDEFICS is the first open state-of-the-art visual language model at the 80B scale!
The model accepts arbitrary sequences of image and text and produces text, similarly to a multimodal ChatGPT.
Blogpost: hf.co/blog/idefics Playground: HuggingFaceM4/idefics_playground
MPT has been added and is now officially supported within Transformers. The repositories from MosaicML have been updated to work best with the model integration within Transformers.
MPT] Add MosaicML's MPT model to transformers by @ArthurZucker & @younesbelkada in #24629GPTQ quantization is now supported in Transformers, through the optimum library. The backend relies on the auto_gptq library, from which we use the GPTQ and QuantLinear classes.
See below for an example of the API, quantizing a model using the new GPTQConfig configuration utility.
from transformers import AutoModelForCausalLM, AutoTokenizer, GPTQConfig
model_name = "facebook/opt-125m"
tokenizer = AutoTokenizer.from_pretrained(model_name)
config = GPTQConfig(bits=4, dataset = "c4", tokenizer=tokenizer, group_size=128, desc_act=False)
# works also with device_map (cpu offload works but not disk offload)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, quantization_config=config)
Most models under TheBloke namespace with the suffix GPTQ should be supported, for example, to load a GPTQ quantized model on TheBloke/Llama-2-13B-chat-GPTQ simply run (after installing latest optimum and auto-gptq libraries):
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "TheBloke/Llama-2-13B-chat-GPTQ"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
For more information about this feature, we recommend taking a look at the following announcement blogpost: https://huggingface.co/blog/gptq-integration
A new pipeline, dedicated to text-to-audio and text-to-speech models, has been added to Transformers. It currently supports the 3 text-to-audio models integrated into transformers: SpeechT5ForTextToSpeech, MusicGen and Bark.
See below for an example:
from transformers import pipeline
classifier = pipeline(model="suno/bark")
output = pipeline("Hey it's HuggingFace on the phone!")
audio = output["audio"]
sampling_rate = output["sampling_rate"]
Classifier-Free Guidance decoding is a text generation technique developed by EleutherAI, announced in this paper. With this technique, you can increase prompt adherence in generation. You can also set it up with negative prompts, ensuring your generation doesn't go in specific directions. See its docs for usage instructions.
A new task guide going into Visual Question Answering has been added to Transformers.
We continue the deprecation of models that was introduced in https://github.com/huggingface/transformers/pull/24787.
By deprecating, we indicate that we will stop maintaining such models, but there is no intention of actually removing those models and breaking support for them (they might one day move into a separate repo/on the Hub, but we would still add the necessary imports to make sure backward compatibility stays). The main point is that we stop testing those models. The usage of the models drives this choice and aims to ease the burden on our CI so that it may be used to focus on more critical aspects of the library.
There are ongoing efforts to translate the transformers' documentation in other languages. These efforts are driven by groups independent to Hugging Face, and their work is greatly appreciated further to lower the barrier of entry to ML and Transformers.
If you'd like to kickstart such an effort or help out on an existing one, please feel free to reach out by opening an issue.
tasks/document_question_answering.md to Korean by @jungnerd in #24588quicktour.md by @wonhyeongseo in #24664serialization.md by @wonhyeongseo in #24686testing.md to Korean by @Sunmin0520 in #24900perf_train_cpu.md to Korean by @seank021 in #24911<tf_xla>.md to Korean by @54data in #24904perf_hardware.md to Korean by @augustinLib in #24966hpo_train.md to Korean by @harheem in #24968perf_infer_cpu.md to Korean by @junejae in #24920transformers_agents.md to Korean by @sim-so in #24881perf_infer_gpu_many.md to Korean by @heuristicwave in #24943perf_infer_gpu_one.md to Korean by @eenzeenee in #24978add_tensorflow_model.md to Korean by @keonju2 in #25017perf_train_cpu_many.md to Korean by @nuatmochoi in #24923add_new_model.md to Korean by @mjk0618 in #24957model_summary.md to Korean by @0525hhgus in #24625philosophy.md to Korean by @TaeYupNoh in #25010perf_train_tpu_tf.md to Korean by @0525hhgus in #25433Addition of input_data_format argument to image transforms and ImageProcessor methods, allowing the user to explicitly set the data format of the images being processed. This enables processing of images with non-standard number of channels e.g. 4 or removes error which occur when the data format was inferred but the channel dimension was ambiguous.
import numpy as np
from transformers import ViTImageProcessor
img = np.random.randint(0, 256, (4, 6, 3))
image_processor = ViTImageProcessor()
inputs = image_processor(img, image_mean=0, image_std=1, input_data_format="channels_first")
torch.scaled_dot_product_attention & Flash AttentionUsers are not aware that it is possible to force dispatch torch.scaled_dot_product_attention method from torch to use Flash Attention kernels. This leads to considerable speedup and memory saving, and is also compatible with quantized models. We decided to make this explicit to users in the documentation.
In a nutshell, one can just run:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("facebook/opt-350m")
model = AutoModelForCausalLM.from_pretrained("facebook/opt-350m").to("cuda")
# convert the model to BetterTransformer
model.to_bettertransformer()
input_text = "Hello my dog is cute and"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
+ with torch.backends.cuda.sdp_kernel(enable_flash=True, enable_math=False, enable_mem_efficient=False):
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
to enable Flash-attenion in their model. However, this feature does not support padding yet.
Users will no longer encounter CPU RAM OOM when using FSDP to train very large models in multi-gpu or multi-node multi-gpu setting.
Users no longer have to pass fsdp_transformer_layer_cls_to_wrap as the code now use _no_split_modules by default which is available for most of the popular models. DeepSpeed Z3 init now works properly with Accelerate Launcher + Trainer.
Trainer classThe default optimizer in the Trainer class has been updated to be adam_torch rather than our own adam_hf, as the official Torch optimizer is more robust and fixes some issues.
In order to keep the old behavior, ensure that you pass "adamw_hf" as the optim value in your TrainingArguments.
adamw_hf to adamw_torch 🚨🚨🚨 by @muellerzr in #25109There was an issue with the definition of the rescale of values with ViVit and EfficientNet. These have been fixed, but will result in different model outputs for both of these models. To understand the change and see what needs to be done to obtain previous results, please take a look at the following PR.
The EfficientNetForImageClassification model class did not follow conventions and added a softmax to the model logits. This was removed so that it respects the convention set by other models.
In order to obtain previous results, pass the model logits through a softmax.
Some SPM models had issues with their management of added tokens. Namely the Llama and T5, among others, were behaving incorrectly. These have been updated in https://github.com/huggingface/transformers/pull/25224.
An option to obtain the previous behavior was added through the legacy flag, as explained in the PR linked above.
SPM] Finish fix spm models 🚨🚨🚨 by @ArthurZucker in #25224use_cache=True by @ydshieh in #24893test_model_parallelism for FalconModel by @ydshieh in #24914Llama2] replace self.pretraining_tp with self.config.pretraining_tp by @younesbelkada in #24906image_processing_vilt.py wrong default documented by @stas00 in #24931main_input_name in src/transformers/keras_callbacks.py by @ydshieh in #24916LogitsProcessor class by @shauray8 in #24848RWKV] Add Gradient Checkpointing support for RWKV by @younesbelkada in #24955Parameter.ds_numel by @apoorvkh in #24942LlamaConfig] Nit: pad token should be None by default by @ArthurZucker in #24958llama tokenization doctest by @ydshieh in #24990bnb] Add simple check for bnb import by @younesbelkada in #24995Llama] remove persistent inv_freq tensor by @ArthurZucker in #24998logging.py] set default stderr path if None by @ArthurZucker in #25033TrainingArgs to wandb.config without sanitization. by @parambharat in #250358bit] Fix 8bit corner case with Blip2 8bit by @younesbelkada in #25047RWKV] Add note in doc on RwkvStoppingCriteria by @ArthurZucker in #25055TF32 flag for PyTorch cuDNN backend by @XuehaiPan in #25075per_gpu_eval_batch_size with per_device_eval_batch_size in readme of multiple-choice task by @statelesshz in #25078generate] Only warn users if the generation_config's max_length is set to the default value by @ArthurZucker in #25030ForSequenceClassification] Support left padding by @ArthurZucker in #24979TF] Also apply patch to support left padding by @ArthurZucker in #25085test_model_is_small by @connor-henderson in #25087PreTrainedTokenizerFast] Keep properties from fast tokenizer by @ArthurZucker in #25053MusicgenForConditionalGeneration tests by @ydshieh in #25091T5, MT5, UMT5] Add [T5, MT5, UMT5]ForSequenceClassification by @sjrl in #24726PvtModelIntegrationTest::test_inference_fp16 by @ydshieh in #25106use_auth_token -> token by @ydshieh in #25083T5/LlamaTokenizer] default legacy to None to not always warn by @ArthurZucker in #25131MptConfig] support from pretrained args by @ArthurZucker in #25116token things by @ydshieh in #25146.push_to_hub and cleanup get_full_repo_name usage by @Wauplin in #25120use_auth_token -> token in example scripts by @ydshieh in #25167Mpt] Fix mpt slow test by @younesbelkada in #25170InstructBlip] Fix instructblip slow test by @younesbelkada in #25171_prepare_output_docstrings by @ydshieh in #25202PreTrainedModel] Wrap cuda and to method correctly by @younesbelkada in #25206all_model_classes in FlaxBloomGenerationTest by @ydshieh in #25211pipeline] revisit device check for pipeline by @younesbelkada in #25207Pix2Struct] Fix pix2struct cross attention by @younesbelkada in #25200Docs/quantization] Clearer explanation on how things works under the hood. + remove outdated info by @younesbelkada in #25216MPT] Add require_bitsandbytes on MPT integration tests by @younesbelkada in #25201Detr] Fix detr BatchNorm replacement issue by @younesbelkada in #25230token arugment in example scripts by @ydshieh in #25172pytest_options={"rA": None} in CI by @ydshieh in #25263num_hidden_layers=2 🚀🚀🚀 by @ydshieh in #25266pytest_num_workers=8 for torch/tf jobs by @ydshieh in #25274report_to logging integrations in docstring by @tomaarsen in #25281bark could have tiny model by @ydshieh in #25290trust_remote_code in example scripts by @Jackmin801 in #25248Repository to upload_folder by @sgugger in #25095NoRepeatNGramLogitsProcessor Example for LogitsProcessor class by @Rishab26 in #25186torch.compile() for vision models by @merveenoyan in #24748test_model_parallelism by @ydshieh in #25359token in example template by @ydshieh in #25351torch_job worker(s) crashing by @ydshieh in #25374token by @ydshieh in #25382OneFormerModelTest.test_model_with_labels by @ydshieh in #25383TopPLogitsWarper by @chiral-carbon in #25361device_map is passed by @gante in #25413torch.compile() docs by @merveenoyan in #25432examples to tests to run when setup.py is modified by @ydshieh in #25437main on PRs/branches if setup.py is not modified by @ydshieh in #25445main on PRs/branches" by @ydshieh in #25466auxiliary_head is None in UperNetPreTrainedModel by @mmurray in #25514MaskFormerModelIntegrationTest OOM by @ydshieh in #25544torch.fx tests on nightly CI by @ydshieh in #25549test_onnx_runtime_optimize for now by @ydshieh in #25560Docs] Fix un-rendered images by @younesbelkada in #25561TRANSFORMERS_TEST_DEVICE by @vvvm23 in #25506test_beam_search_xla_generate_simple for T5 by @ydshieh in #25566resize_embedding] Introduce pad_to_multiple_of and guidance by @ArthurZucker in #25088SwitchTransformers] Remove unused module by @ArthurZucker in #25427NllbMoe] Update code to properly support loss computation by @ArthurZucker in #25429Tests] Fix failing 8bit test by @younesbelkada in #25564test_contrastive_generate for TFXLNet by @ydshieh in #25574Docs / BetterTransformer ] Added more details about flash attention + SDPA by @younesbelkada in #25265.cuda with .to(torch_device) in tests by @vvvm23 in #25571split_special_tokens] Add support for split_special_tokens argument to encode by @ArthurZucker in #25081Llama] remove prompt and fix prefix finetuning by @ArthurZucker in #25565TokenizerFast] Fix setting prefix space in init by @ArthurZucker in #25563resize_token_embeddings by @SunMarc in #25596The following contributors have made significant changes to the library over the last release:
quicktour.md (#24664)serialization.md (#24686)testing.md to Korean (#24900)T5, MT5, UMT5] Add [T5, MT5, UMT5]ForSequenceClassification (#24726)trust_remote_code in example scripts (#25248)add_new_model.md to Korean (#24957)Transformers is growing a lot and to ease a bit the burden of maintenance on our side, we have taken the decision to deprecate models that are not use…
Llama 2 was proposed in LLaMA: Open Foundation and Fine-Tuned Chat Models by Hugo Touvron et al. It builds upon the Llama architecture adding Grouped Query Attention for efficient inference.
The MusicGen model was proposed in the paper Simple and Controllable Music Generation by Jade Copet, Felix Kreuk, Itai Gat, Tal Remez, David Kant, Gabriel Synnaeve, Yossi Adi and Alexandre Défossez.
MusicGen is a single stage auto-regressive Transformer model capable of generating high-quality music samples conditioned on text descriptions or audio prompts. The text descriptions are passed through a frozen text encoder model to obtain a sequence of hidden-state representations. MusicGen is then trained to predict discrete audio tokens, or audio codes, conditioned on these hidden-states. These audio tokens are then decoded using an audio compression model, such as EnCodec, to recover the audio waveform.
Through an efficient token interleaving pattern, MusicGen does not require a self-supervised semantic representation of the text/audio prompts, thus eliminating the need to cascade multiple models to predict a set of codebooks (e.g. hierarchically or upsampling). Instead, it is able to generate all the codebooks in a single forward pass.
Bark is a transformer-based text-to-speech model proposed by Suno AI in suno-ai/bark.
The MMS model was proposed in Scaling Speech Technology to 1,000+ Languages by Vineel Pratap, Andros Tjandra, Bowen Shi, Paden Tomasello, Arun Babu, Sayani Kundu, Ali Elkahky, Zhaoheng Ni, Apoorv Vyas, Maryam Fazel-Zarandi, Alexei Baevski, Yossi Adi, Xiaohui Zhang, Wei-Ning Hsu, Alexis Conneau, Michael Auli
The EnCodec neural codec model was proposed in High Fidelity Neural Audio Compression by Alexandre Défossez, Jade Copet, Gabriel Synnaeve, Yossi Adi.
The InstructBLIP model was proposed in InstructBLIP: Towards General-purpose Vision-Language Models with Instruction Tuning by Wenliang Dai, Junnan Li, Dongxu Li, Anthony Meng Huat Tiong, Junqi Zhao, Weisheng Wang, Boyang Li, Pascale Fung, Steven Hoi. InstructBLIP leverages the BLIP-2 architecture for visual instruction tuning.
The UMT5 model was proposed in UniMax: Fairer and More Effective Language Sampling for Large-Scale Multilingual Pretraining by Hyung Won Chung, Xavier Garcia, Adam Roberts, Yi Tay, Orhan Firat, Sharan Narang, Noah Constant.
Umt5] Add google's umt5 to transformers by @ArthurZucker in #24477The MRA model was proposed in Multi Resolution Analysis (MRA) for Approximate Self-Attention by Zhanpeng Zeng, Sourav Pal, Jeffery Kline, Glenn M Fung, and Vikas Singh.
The Vivit model was proposed in ViViT: A Video Vision Transformer by Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Lučić, Cordelia Schmid. The paper proposes one of the first successful pure-transformer based set of models for video understanding.
The last version to support Python 3.7 was 4.30.x, as it reached end-of-life on June 27, 2023 and is no longer supported by the Python Software Foundation.
The last version to support PyTorch 1.9 was 4.30.x. As it has been more than 2 years, and we're looking forward to using features available in PyTorch 1.10 and up, we do not support PyTorch 1.9 for v4.31 and up.
This PR adds RoPE scaling to the LLaMa and GPTNeoX families of models. It allows us to extrapolate and go beyond the original maximum sequence length (e.g. 2048 tokens on LLaMA), without fine-tuning. It offers two strategies:
Tools now return a type that is specific to agents. This type can return a serialized version of itself (a string), that either points to a file on-disk or to the object's content. This should make interaction with text-based systems much simpler.
Models with potentially tied weights dropped off some keys from the state dict even when the weights were not tied. This has now been fixed and more generally, the whole experience of loading a model with state dict that don't match exactly should be improved in this release.
This PR adds a method of predicting timestamps at the word (or even token) level, by analyzing the cross-attentions and applying dynamic time warping.
A new auto model is added, AutoModelForTextEncoding. It is to be used when you want to extract the text encoder from an encoder-decoder architecture.
Transformers is growing a lot and to ease a bit the burden of maintenance on our side, we have taken the decision to deprecate models that are not used a lot. Those models will never actually disappear from the library, but we will stop testing them or accepting PRs modifying them. (enfin ça The criteria to identify models to deprecate was less than 1,000 unique downloads in the last 30 days for models that are at least one year old. The list of deprecated models is:
Fixes an issue with stripped spaces for the T5 family tokenizers. If this impacts negatively inference/training with your models, please let us know by opening an issue.
T5Tokenize] Fix T5 family tokenizers⚠️⚠️ by @ArthurZucker in #24565add trust_remote_code option to CLI download cmd by @radames in #24097
Fix typo in Llama docstrings by @Kh4L in #24020
Avoid GPT-2 daily CI job OOM (in TF tests) by @ydshieh in #24106
[Lllama] Update tokenization code to ensure parsing of the special tokens [core] by @ArthurZucker in #24042
PLAM => PaLM by @xingener in #24129
[bnb] Fix bnb config json serialization by @younesbelkada in #24137
Correctly build models and import call_context for older TF versions by @Rocketknight1 in #24138
Generate: PT's top_p enforces min_tokens_to_keep when it is 1 by @gante in #24111
fix bugs with trainer by @pacman100 in #24134
Fix TF Rag OOM issue by @ydshieh in #24122
Fix SAM OOM issue on CI by @ydshieh in #24125
Fix XGLM OOM on CI by @ydshieh in #24123
[SAM] Fix sam slow test by @younesbelkada in #24140
[lamaTokenizerFast] Update documentation by @ArthurZucker in #24132
[BlenderBotSmall] Update doc example by @ArthurZucker in #24092
Fix Pipeline CI OOM issue by @ydshieh in #24124
[documentation] grammatical fixes in image_classification.mdx by @LiamSwayne in #24141
Fix typo in streamers.py by @freddiev4 in #24144
[tests] fix bitsandbytes import issue by @stas00 in #24151
Avoid OOM in doctest CI by @ydshieh in #24139
Fix Wav2Vec2 CI OOM by @ydshieh in #24190
Fix push to hub by @NielsRogge in #24187
Change ProgressCallback to use dynamic_ncols=True by @gmlwns2000 in #24101
[i18n]Translated "attention.mdx" to korean by @kihoon71 in #23878
Generate: force caching on the main model, in assisted generation by @gante in #24177
Fix device issue in OpenLlamaModelTest::test_model_parallelism by @ydshieh in #24195
Update GPTNeoXLanguageGenerationTest by @ydshieh in #24193
typo: fix typos in CONTRIBUTING.md and deepspeed.mdx by @zsj9509 in #24184
Generate: detect special architectures when loaded from PEFT by @gante in #24198
🌐 [i18n-KO] Translated tasks_summary.mdx to Korean by @kihoon71 in #23977
🚨🚨🚨 Replace DataLoader logic for Accelerate in Trainer, remove unneeded tests 🚨🚨🚨 by @muellerzr in #24028
Fix _load_pretrained_model by @SunMarc in #24200
Fix steps bugs in no trainer examples by @Ethan-yt in #24197
Skip RWKV test in past CI by @ydshieh in #24204
Remove unnecessary aten::to overhead in llama by @fxmarty in #24203
Update WhisperForAudioClassification doc example by @ydshieh in #24188
Finish dataloader integration by @muellerzr in #24201
Add the number of model test failures to slack CI report by @ydshieh in #24207
fix: TextIteratorStreamer cannot work with pipeline by @yuanwu2017 in #23641
Update (TF)SamModelIntegrationTest by @ydshieh in #24199
Improving error message when using use_safetensors=True. by @Narsil in #24232
Safely import pytest in testing_utils.py by @amyeroberts in #24241
fix overflow when training mDeberta in fp16 by @sjrl in #24116
deprecate use_mps_device by @pacman100 in #24239
Tied params cleanup by @sgugger in #24211
[Time Series] use mean scaler when scaling is a boolean True by @kashif in #24237
TF: standardize test_model_common_attributes for language models by @gante in #23457
Generate: GenerationConfig can overwrite attributes at from_pretrained time by @gante in #24238
Add torch >=1.12 requirement for Tapas by @ydshieh in #24251
Update urls in warnings for rich rendering by @IvanReznikov in #24136
Fix how we detect the TF package by @Rocketknight1 in #24255
Stop storing references to bound methods via tf.function by @Rocketknight1 in #24146
Skip GPT-J fx tests for torch < 1.12 by @ydshieh in #24256
docs wrt using accelerate launcher with trainer by @pacman100 in #24250
update FSDP save and load logic by @pacman100 in #24249
Fix URL in comment for contrastive loss function by @taepd in #24271
QA doc: import torch before it is used by @ByronHsu in #24228
Skip some TQAPipelineTests tests in past CI by @ydshieh in #24267
TF: CTRL with native embedding layers by @gante in #23456
Adapt Wav2Vec2 conversion for MMS lang identification by @patrickvonplaten in #24234
Update check of core deps by @sgugger in #24277
Pix2StructImageProcessor requires torch>=1.11.0 by @ydshieh in #24270
Fix Debertav2 embed_proj by @WissamAntoun in #24205
Clean up old Accelerate checks by @sgugger in #24279
Fix bug in slow tokenizer conversion, make it a lot faster by @stephantul in #24266
Fix check_config_attributes: check all configuration classes by @ydshieh in #24231
Fix LLaMa beam search when using parallelize by @FeiWang96 in #24224
remove unused is_decoder parameter in DetrAttention by @JayL0321 in #24226
Split common test from core tests by @sgugger in #24284
[fix] bug in BatchEncoding.getitem by @flybird1111 in #24293
Fix image segmentation tool bug by @amyeroberts in #23897
[Docs] Improve docs for MMS loading of other languages by @patrickvonplaten in #24292
Update README_zh-hans.md by @CooperFu in #24181
deepspeed init during eval fix by @pacman100 in #24298
[EnCodec] Changes for 32kHz ckpt by @sanchit-gandhi in #24296
[Docs] Fix the paper URL for MMS model by @hitchhicker in #24302
Update tokenizer_summary.mdx (grammar) by @belladoreai in #24286
Beam search type by @jprivera44 in #24288
Make can_generate as class method by @ydshieh in #24299
Update test versions on README.md by @sqali in #24307
[SwitchTransformers] Fix return values by @ArthurZucker in #24300
Fix functional TF Whisper and modernize tests by @Rocketknight1 in #24301
Big TF test cleanup by @Rocketknight1 in #24282
Fix ner average grouping with no groups by @Narsil in #24319
Fix ImageGPT doc example by @amyeroberts in #24317
Add test for proper TF input signatures by @Rocketknight1 in #24320
Adding ddp_broadcast_buffers argument to Trainer by @TevenLeScao in #24326
error bug on saving distributed optim state when using data parallel by @xshaun in #24108
🌐 [i18n-KO] Fixed tutorial/preprocessing.mdx by @sim-so in #24156
pin apex to a speicifc commit (for DeepSpeed CI docker image) by @ydshieh in #24351
byebye Hub connection timeout by @ydshieh in #24350
Clean up disk sapce during docker image build for transformers-pytorch-gpu by @ydshieh in #24346
Fix KerasMetricCallback: pass generate_kwargs even if use_xla_generation is False by @Kripner in #24333
Fix device issue in SwitchTransformers by @ydshieh in #24352
Update MMS integration docs by @vineelpratap in #24311
Make AutoFormer work with previous torch version by @ydshieh in #24357
Fix ImageGPT doctest by @amyeroberts in #24353
Fix link to documentation in Install from Source by @SoyGema in #24336
docs: add BentoML to awesome-transformers by @aarnphm in #24344
[Doc Fix] Fix model name path in the transformers doc for AutoClasses by @riteshghorse in #24329
Fix the order in GPTNeo's docstring by @qgallouedec in #24358
Respect explicitly set framework parameter in pipeline by @denis-ismailaj in #24322
Allow passing kwargs through to TFBertTokenizer by @Rocketknight1 in #24324
Fix resuming PeftModel checkpoints in Trainer by @llohann-speranca in #24274
TensorFlow CI fixes by @Rocketknight1 in #24360
Update tiny models for pipeline testing. by @ydshieh in #24364
[modelcard] add audio classification to task list by @sanchit-gandhi in #24363
[Whisper] Make tests faster by @sanchit-gandhi in #24105
Rename test to be more accurate by @sgugger in #24374
Add a check in ImageToTextPipeline._forward by @ydshieh in #24373
[Tokenizer doc] Clarification about add_prefix_space by @ArthurZucker in #24368
style: add BitsAndBytesConfig repr function by @aarnphm in #24331
Better test name and enable pipeline test for pix2struct by @ydshieh in #24377
Skip a tapas (tokenization) test in past CI by @ydshieh in #24378
[Whisper Docs] Nits by @ArthurZucker in #24367
[GPTNeoX] Nit in config by @ArthurZucker in #24349
[Wav2Vec2 - MMS] Correct directly loading adapters weights by @patrickvonplaten in #24335
Migrate doc files to Markdown. by @sgugger in #24376
Update deprecated torch.ger by @kit1980 in #24387
[docs] Fix NLLB-MoE links by @stevhliu in #24388
Add ffmpeg for doc_test_job on CircleCI by @ydshieh in #24397
byebye Hub connection timeout - Recast by @ydshieh in #24399
fix type annotation for debug arg by @Bearnardd in #24033
[Trainer] Fix optimizer step on PyTorch TPU by @cowanmeg in #24389
Fix gradient checkpointing + fp16 autocast for most models by @younesbelkada in #24247
Clean up dist import by @muellerzr in #24402
Check auto mappings could be imported via from transformers by @ydshieh in #24400
Remove redundant code from TrainingArgs by @muellerzr in #24401
Explicit arguments in from_pretrained by @ydshieh in #24306
[ASR pipeline] Check for torchaudio by @sanchit-gandhi in #23953
TF safetensors reduced mem usage by @Rocketknight1 in #24404
Skip test_conditional_generation_pt_pix2struct in Past CI (torch < 1.11) by @ydshieh in #24417
[bnb] Fix bnb serialization issue with new release by @younesbelkada in #24416
Revert "Fix gradient checkpointing + fp16 autocast for most models" by @younesbelkada in #24420
Fix save_cache version in config.yml by @ydshieh in #24419
Update RayTune doc link for Hyperparameter tuning by @JoshuaEPSamuel in #24422
TF CI fix for Segformer by @Rocketknight1 in #24426
Refactor hyperparameter search backends by @alexmojaki in #24384
Clarify batch size displayed when using DataParallel by @sgugger in #24430
Save site-packages as cache in CircleCI job by @ydshieh in #24424
[llama] Fix comments in weights converter by @weimingzha0 in #24436
[Trainer] Fix .to call on 4bit models by @younesbelkada in #24444
fix the grad_acc issue at epoch boundaries by @pacman100 in #24415
Replace python random with torch.rand to enable dynamo.export by @BowenBao in #24434
Fix typo by @siryuon in #24440
Fix some TFWhisperModelIntegrationTests by @ydshieh in #24428
fixes issue when saving fsdp via accelerate's FSDP plugin by @pacman100 in #24446
Allow dict input for audio classification pipeline by @sanchit-gandhi in #23445
Update JukeboxConfig.from_pretrained by @ydshieh in #24443
Improved keras imports by @Rocketknight1 in #24448
add missing alignment_heads to Whisper integration test by @hollance in #24487
Fix tpu_metrics_debug by @cowanmeg in #24452
Update AlbertModel type annotation by @amyeroberts in #24450
[pipeline] Fix str device issue by @younesbelkada in #24396
when resume from peft checkpoint, the model should be trainable by @sywangyi in #24463
deepspeed z1/z2 state dict fix by @pacman100 in #24489
Update InstructBlipModelIntegrationTest by @ydshieh in #24490
Update token_classification.md by @condor-cp in #24484
Add support for for loops in python interpreter by @sgugger in #24429
[InstructBlip] Add accelerate support for instructblip by @younesbelkada in #24488
Compute dropout_probability only in training mode by @ydshieh in #24486
Fix 'local_rank' AttiributeError in Trainer class by @mocobeta in #24297
Compute dropout_probability only in training mode (SpeechT5) by @ydshieh in #24498
Fix link in utils by @SoyGema in #24501
🚨🚨 Fix group beam search by @hukuda222 in #24407
Generate: group_beam_search requires diversity_penalty>0.0 by @gante in #24456
Generate: min_tokens_to_keep has to be >= 1 by @gante in #24453
Fix TypeError: Object of type int64 is not JSON serializable by @xiaoli in #24340
Fix poor past ci by @ydshieh in #24485
🌐 [i18n-KO] Translated tflite.mdx to Korean by @0525hhgus in #24435
use accelerate autocast in jit eval path, since mix precision logic is… by @sywangyi in #24460
Update hyperparameter_search.py by @pacman100 in #24515
[T5] Add T5ForQuestionAnswering and MT5ForQuestionAnswering by @sjrl in #24481
set model to training mode before accelerate.prepare by @sywangyi in #24520
Update huggingface_hub commit sha by @ydshieh in #24527
Find module name in an OS-agnostic fashion by @sgugger in #24526
Fix LR scheduler based on bs from auto bs finder by @muellerzr in #24521
[Mask2Former] Remove SwinConfig by @NielsRogge in #24259
Allow backbones not in backbones_supported - Maskformer Mask2Former by @amyeroberts in #24532
Fix Typo by @tony9402 in #24530
Finishing tidying keys to ignore on load by @sgugger in #24535
Add bitsandbytes support for gpt2 models by @DarioSucic in #24504
⚠️ Time to say goodbye to py37 by @ydshieh in #24091
Unpin DeepSpeed and require DS >= 0.9.3 by @ydshieh in #24541
Allow for warn_only selection in enable_full_determinism by @Frank995 in #24496
Fix typing annotations for FSDP and DeepSpeed in TrainingArguments by @mryab in #24549
Update PT/TF weight conversion after #24030 by @ydshieh in #24547
Update EncodecIntegrationTest by @ydshieh in #24553
[gpt2-int8] Add gpt2-xl int8 test by @younesbelkada in #24543
Fix processor init bug if image processor undefined by @amyeroberts in #24554
[InstructBlip] Add instruct blip int8 test by @younesbelkada in #24555
Update PT/Flax weight conversion after #24030 by @ydshieh in #24556
Make PT/Flax tests could be run on GPU by @ydshieh in #24557
Update masked_language_modeling.md by @condor-cp in #24560
Fixed OwlViTModel inplace operations by @pasqualedem in #24529
Update old existing feature extractor references by @amyeroberts in #24552
Fix Typo by @tony9402 in #24559
Fix annotations by @tony9402 in #24571
Docs: 4 bit doc corrections by @gante in #24572
Revert "Fix typing annotations for FSDP and DeepSpeed in TrainingArguments" by @sgugger in #24574
Update some torchscript tests after #24505 by @ydshieh in #24566
Removal of deprecated vision methods and specify deprecation versions by @amyeroberts in #24570
Fix ESM models buffers by @sgugger in #24576
Check all objects are equally in the main __init__ file by @ydshieh in #24573
Fix annotations by @tony9402 in #24582
fix peft ckpts not being pushed to hub by @pacman100 in #24578
Udate link to RunHouse hardware setup documentation. by @BioGeek in #24590
Show a warning for missing attention masks when pad_token_id is not None by @hackyon in #24510
Make (TF) CI faster (test only a subset of model classes) by @ydshieh in #24592
Speed up TF tests by reducing hidden layer counts by @Rocketknight1 in #24595
[several models] improve readability by @stas00 in #24585
Use protobuf 4 by @ydshieh in #24599
Limit Pydantic to V1 in dependencies by @lig in #24596
🌐 [i18n-KO] Translated perplexity.mdx to Korean by @HanNayeoniee in #23850
[Time-Series] Added blog-post to tips by @elisim in #24482
Pin Pillow for now by @ydshieh in #24633
Fix loading dataset docs link in run_translation.py example by @SoyGema in #24594
Generate: multi-device support for contrastive search by @gante in #24635
Generate: force cache with inputs_embeds forwarding by @gante in #24639
precompiled_charsmap checking before adding to the normalizers' list for XLNetTokenizerFast conversion. by @shahad-mahmud in #24618
Fix audio feature extractor deps by @sanchit-gandhi in #24636
llama fp16 torch.max bug fix by @prathikr in #24561
documentation_tests.txt - sort filenames alphabetically by @amyeroberts in #24647
Update warning messages reffering to post_process_object_detection by @rafaelpadilla in #24649
Add finetuned_from property in the autogenerated model card by @sgugger in #24528
Make warning disappear for remote code in pipelines by @sgugger in #24603
Fix EncodecModelTest::test_multi_gpu_data_parallel_forward by @ydshieh in #24663
Fix VisionTextDualEncoderIntegrationTest by @ydshieh in #24661
Add is_torch_mps_available function to utils by @NripeshN in #24660
Unpin huggingface_hub by @ydshieh in #24667
Fix model referenced and results in documentation. Model mentioned was inaccessible by @rafaelpadilla in #24609
Add Nucleotide Transformer notebooks and restructure notebook list by @Rocketknight1 in #24669
LlamaTokenizer should be picklable by @icyblade in #24681
Add dropouts to GPT-NeoX by @ZHAOTING in #24680
DeepSpeed/FSDP ckpt saving utils fixes and FSDP training args fixes by @pacman100 in #24591
Avoid import sentencepiece_model_pb2 in utils.__init__.py by @ydshieh in #24689
Fix integration with Accelerate and failing test by @muellerzr in #24691
[MT5] Fix CONFIG_MAPPING issue leading it to load umt5 class by @ArthurZucker in #24678
Fix flaky test_for_warning_if_padding_and_no_attention_mask by @ydshieh in #24706
Whisper: fix prompted max length by @gante in #24666
Enable conversational pipeline for GPTSw3Tokenizer by @saattrupdan in #24648
[T5] Adding model_parallel = False to T5ForQuestionAnswering and MT5ForQuestionAnswering by @sjrl in #24684
Docs: change some input_ids doc reference from BertTokenizer to AutoTokenizer by @gante in #24730
add link to accelerate doc by @SunMarc in #24601
[Patch-t5-tokenizer] Patches the changes on T5 to make sure previous behaviour is still valide for beginning of words by @ArthurZucker in #24622
Fix typo in LocalAgent by @jamartin9 in #24736
fix: Text splitting in the BasicTokenizer by @connor-henderson in #22280
Docs: add kwargs type to fix formatting by @gante in #24733
add gradient checkpointing for distilbert by @jordane95 in #24719
Skip keys not in the state dict when finding mismatched weights by @sgugger in #24749
Fix non-deterministic Megatron-LM checkpoint name by @janEbert in #24674
[InstructBLIP] Fix bos token of LLaMa checkpoints by @NielsRogge in #24492
Skip some slow tests for doctesting in PRs (Circle)CI by @ydshieh in #24753
Fix lr scheduler not being reset on reruns by @muellerzr in #24758
:bug: Handle empty gen_kwargs for seq2seq trainer prediction_step function by @gkumbhat in #24759
Allow existing configs to be registered by @sgugger in #24760
Unpin protobuf in docker file (for daily CI) by @ydshieh in #24761
Fix eval_accumulation_steps leading to incorrect metrics by @muellerzr in #24756
Add MobileVitV2 to doctests by @amyeroberts in #24771
Docs: Update logit processors call docs by @gante in #24729
Replacement of 20 asserts with exceptions by @Baukebrenninkmeijer in #24757
Update default values of bos/eos token ids in CLIPTextConfig by @ydshieh in #24773
Fix pad across processes dim in trainer and not being able to set the timeout by @muellerzr in #24775
gpt-bigcode: avoid zero_ to support Core ML by @pcuenca in #24755
Remove WWT from README by @LysandreJik in #24672
Rm duplicate pad_across_processes by @muellerzr in #24780
Revert "Unpin protobuf in docker file (for daily CI)" by @ydshieh in #24800
Removing unnecessary device=device in modeling_llama.py by @Liyang90 in #24696
[fix] Change the condition of ValueError in "convert_checkpoint_from_transformers_to_megatron" by @SeongBeomLEE in #24769
[DOC] Clarify relationshi load_best_model_at_end and save_total_limit by @BramVanroy in #24614
Upgrade jax/jaxlib/flax pin versions by @ydshieh in #24791
Fix MobileVitV2 doctest checkpoint by @amyeroberts in #24805
Skip torchscript tests for MusicgenForConditionalGeneration by @ydshieh in #24782
Generate: add SequenceBiasLogitsProcessor by @gante in #24334
Add accelerate version in transformers-cli env by @amyeroberts in #24806
Fix typo 'submosules' by @dymil in #24809
Remove Falcon docs for the release until TGI is ready by @Rocketknight1 in #24808
Update setup.py to be compatible with pipenv by @georgiemathews in #24789
Use _BaseAutoModelClass's register method by @fadynakhla in #24810
Run hub tests by @sgugger in #24807
Copy code when using local trust remote code by @sgugger in #24785
Fixing double use_auth_token.pop (preventing private models from being visible). by @Narsil in #24812
set correct model input names for gptsw3tokenizer by @DarioSucic in #24788
Check models used for common tests are small by @sgugger in #24824
[🔗 Docs] Fixed Incorrect Migration Link by @kadirnar in #24793
deprecate sharded_ddp training argument by @statelesshz in #24825
🌐 [i18n-KO] Translated custom_tools.mdx to Korean by @sim-so in #24580
Remove unused code in GPT-Neo by @namespace-Pt in #24826
Add Multimodal heading and Document question answering in task_summary.mdx by @y3sar in #23318
Fix is_vision_available by @ydshieh in #24853
Fix comments for _merge_heads by @bofenghuang in #24855
fix broken links in READMEs by @younesbelkada in #24861
Add TAPEX to the list of deprecated models by @sgugger in #24859
Fix token pass by @sgugger in #24862
The following contributors have made significant changes to the library over the last release:
tutorial/preprocessing.mdx (#24156)custom_tools.mdx to Korean (#24580)Fix push to hubby @NielsRogge in #24187
Fix bnb config json serialization in #24137 by @younesbelkada
Act on deprecations in Accelerate no_trainer examples by @muellerzr in #24053
Transformers has just reached 100k stars on GitHub, and to celebrate we wanted to highlight 100 projects in the vicinity of transformers and we have decided to create an awesome-transformers page to do just that.
We accept PRs to add projects to the list!
By leveraging the bitsandbytes library by @TimDettmers, we add 4-bit support to transformers models!
The Agents framework has been improved and continues to be stabilized. Among bug fixes, here are the important new features that were added:
transformers instead of relying on APIs.AzureOpenAiAgent class to support Azure OpenAI agents.The safetensors library is a safe serialization framework for machine learning tensors. It has been audited and will become the default serialization framework for several organizations (Hugging Face, EleutherAI, Stability AI).
It has now become a core dependency of transformers.
safetensors a core dependency. by @Narsil in #23254The SwiftFormer paper introduces a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations in the self-attention computation with linear element-wise multiplications. A series of models called ‘SwiftFormer’ is built based on this, which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Even their small variant achieves 78.5% top-1 ImageNet1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2× faster compared to MobileViT-v2.
This model augments the Transformer as a deep decomposition architecture, which can progressively decompose the trend and seasonal components during the forecasting process.
MobileViTV2 is the second version of MobileViT, constructed by replacing the multi-headed self-attention in MobileViT with separable self-attention.
PerSAM proposes a minimal modification to SAM to allow dreambooth-like personalization, enabling to segment concepts in new images using just one example.
We add support for loading timm weights within the AutoBackbone API in transformers. timm models can be instantiated through the TimmBackbone class, and then used with any vision model that needs a backbone.
We add conditional text generation to the image to text pipeline; allowing the model to continue generating an initial text prompt according to an image.
A major rework of the internals of the Trainer is underway, leveraging accelerate instead of redefining them in transformers. This should unify both framework and lead to increased interoperability and more efficient development.
accelerator.prepare by @pacman100 in #23914chore: allow protobuf 3.20.3 requirement by @jose-turintech in #22759
Fix link displayed for custom tools by @sgugger in #23274
Remove missplaced test file by @sgugger in #23275
Bring back the PR Refactor doctests + add CI to main by @ydshieh in #23271
[gpt] Gpt2 fix half precision causal mask by @younesbelkada in #23256
Temporary tolerance fix for flaky whipser PT-TF equiv. test by @amyeroberts in #23257
Add top_k argument to post-process of conditional/deformable-DETR by @CreatlV in #22787
transformers-cli -> huggingface-cli by @AlpinDale in #23276
Temporarily increase tol for PT-FLAX whisper tests by @amyeroberts in #23288
Added missing " in CHAT_PROMPT_TEMPLATE by @galatolofederico in #23287
Update custom_tools.mdx: fix link by @mishig25 in #23292
Update transformers_agents.mdx by @mishig25 in #23289
Convert numpy arrays to lists before saving the evaluation metrics as json by @harisankar95 in #23268
Fix doctest files fetch issue by @ydshieh in #23277
skip test_run_squad_no_trainer for now by @ydshieh in #23302
Better check for packages availability by @apbard in #23163
Add gradient_checkpointing parameter to FlaxWhisperEncoder by @raghavanone in #23300
Agents extras by @LysandreJik in #23301
Fix broken links in the agent docs by @sgugger in #23297
Fix typo in gradio-tools docs by @freddyaboulton in #23305
Fix image segmentation tool test by @sgugger in #23306
unpin tf prob by @ydshieh in #23293
Revert "search buffers for dtype" by @sgugger in #23308
Remove LanguageIdentificationTool in __init__.py as we don't have it yet by @ydshieh in #23326
Fix docker image (caused by tensorflow_text) by @ydshieh in #23321
Compute the mask in-place, with less memory reads, and on CUDA on XLNetLMHeadModel by @lezcano in #23332
Only add files with modification outside doc blocks by @ydshieh in #23327
[docs] Fix Agents and Tools docstring by @stevhliu in #23313
OR am I crazy? by @hwuebben in #23295
Handle padding warning in generation when using inputs_embeds by @zrthxn in #23131
replaced assert with raise ValueError for t5, switch_transformers, pix2struct, mt5, longt5, gptsan_japanese. by @susnato in #23273
Use cu118 with cudnn >= 8.6 in docker file by @ydshieh in #23339
Removing one of the twice defined position_embeddings in LongFormer by @GregorySenay in #23343
Fix issue introduced in PR #23163 by @ydshieh in #23363
Typo suggestion by @richardachen in #23360
Fix some is_xxx_available by @ydshieh in #23365
Fix BigBirdForMaskedLM doctest by @ydshieh in #23369
Fix OwlViTForObjectDetection.image_guided_detection doc example by @ydshieh in #23370
Revert "Only add files with modification outside doc blocks" by @ydshieh in #23371
[Bugfix] OPTDecoderLayer does not return attentions when gradient_checkpointing and training is enabled. by @gmlwns2000 in #23367
Skip failing AlignModelTest::test_multi_gpu_data_parallel_forward by @ydshieh in #23374
Fix test typos - audio feature extractors by @LWprogramming in #23310
Added type hints for Graphormer pytorch version by @dewasahu2003 in #23073
Replace NumPy Operations with JAX NumPy Equivalents for JIT Compilation Compatibility by @gojiteji in #23356
Use mkstemp to replace deprecated mktemp by @ready-research in #23372
Fix RwkvModel by @ydshieh in #23392
Update test_batched_inference_image_captioning_conditioned by @ydshieh in #23391
OPT/BioGPT: Improved attention mask shape exception by @gante in #23270
Fix chat prompt in HFAgent by @IvanSedykh in #23335
🌐 [i18n-KO] Translated asr.mdx to Korean by @sim-so in #23106
Minor fixes in transformers-tools by @Wauplin in #23364
[Pix2Struct] Add conditional generation on docstring example by @younesbelkada in #23399
Generate: faster can_generate check on TF and Flax by @gante in #23398
[AutoModel] fix torch_dtype=auto in from_pretrained by @stas00 in #23379
Docs: add link to assisted generation blog post by @gante in #23397
Build with non Python files by @sgugger in #23405
Generate: add test to check KV format by @gante in #23403
Replace appends with list comprehension. by @ttsugriy in #23359
Fix smdistributed check by @sgugger in #23414
Why crash the whole run when HFHub gives a 50x error? by @ropoctl in #23320
Run doctest (in PRs) only when some doc example(s) are modified by @ydshieh in #23387
Update ConvNextV2ModelIntegrationTest::test_inference_image_classification_head by @ydshieh in #23402
Fix a typo in HfAgent docstring. by @ttsugriy in #23420
Use dict.items to avoid unnecessary lookups. by @ttsugriy in #23415
Update 3 docker files to use cu118 by @ydshieh in #23406
[SAM] fix sam slow test by @younesbelkada in #23376
Return early once stop token is found. by @ttsugriy in #23421
[Reland] search model buffers for dtype as the last resort by @cyyever in #23319
Add Missing tokenization test [electra] by @IMvision12 in #22997
Small fixes and link in the README by @LysandreJik in #23428
TF: embeddings out of bounds check factored into function by @gante in #23427
Update Bigbird Pegasus tests by @ydshieh in #23431
Encoder-Decoder: add informative exception when the decoder is not compatible by @gante in #23426
Remove hardcoded prints in Trainer by @hugoabonizio in #23432
Fix device issue in SwiftFormerModelIntegrationTest::test_inference_image_classification_head by @ydshieh in #23435
Generate: skip left-padding tests on old models by @gante in #23437
remove unnecessary print in gpt neox sequence classifier by @cfhammill in #23433
🌐 [i18n-KO] Translated tasks/zero_shot_object_detection.mdx to Korean by @HanNayeoniee in #23430
Fix (skip) a pipeline test for RwkvModel by @ydshieh in #23444
Fix DecisionTransformerConfig doctring by @joaoareis in #23450
TF: GPT2 with native embedding layers by @gante in #23436
Make RwkvModel accept attention_mask but discard it internally by @ydshieh in #23442
Less flaky test_assisted_decoding_matches_greedy_search by @ydshieh in #23451
Update tiny models and pipeline tests by @ydshieh in #23446
Properly guard PyTorch stuff by @sgugger in #23452
Add an option to log result from the Agent by @sgugger in #23454
Clean up CUDA kernels by @sgugger in #23455
fix bug in group_texts function, that was inserting short batches by @BodaSadalla98 in #23429
feat: Whisper prompting by @connor-henderson in #22496
README: Fix affiliation for MEGA by @julien-c in #23394
Remove .data usages in optimizations.py by @alanwaketan in #23417
TF port of the Segment Anything Model (SAM) by @Rocketknight1 in #22970
[RWKV] Rwkv fix for 8bit inference by @younesbelkada in #23468
Use config to set name and description if not present by @sgugger in #23473
Fix transformers' DeepSpeed CI job by @ydshieh in #23463
Fix PretrainedConfig min_length docstring by @joaoareis in #23471
Fix: Change tensors to integers for torch.dynamo and torch.compile compatibility by @loevlie in #23475
[Blip] Remove redundant shift right by @younesbelkada in #23153
Fix DeepSpeed stuff in the nightly CI by @ydshieh in #23478
Fix confusing transformers installation in CI by @ydshieh in #23465
Fix tests/repo_utils/test_get_test_info.py by @ydshieh in #23485
Debug example code for MegaForCausalLM by @Tylersuard in #23382
Remove erroneous img closing tag by @xenova in #23646
Fix tensor device while attention_mask is not None by @zspo in #23538
Fix accelerate logger bug by @younesbelkada in #23650
Bugfix: LLaMA layer norm incorrectly changes input type and consumers lots of memory by @TimDettmers in #23535
Fix wav2vec2 is_batched check to include 2-D numpy arrays by @LWprogramming in #23223
changing the requirements to a cpu torch version that works by @sshahrokhi in #23483
Fix SAM tests and use smaller checkpoints by @Rocketknight1 in #23656
Update workflow files by @ydshieh in #23658
small fix to remove unused eos in processor when it's not used. by @Narsil in #23408
Fix typo in a parameter name for open llama model by @aaalexlit in #23637
Fix PyTorch SAM tests by @ydshieh in #23682
🌐 [i18n-KO] Translated tasks/monocular_depth_estimation.mdx to Korean by @HanNayeoniee in #23621
Fix a BridgeTower test by @ydshieh in #23694
[SAM] Fixes pipeline and adds a dummy pipeline test by @younesbelkada in #23684
TF version compatibility fixes by @Rocketknight1 in #23663
[Blip] Fix blip doctest by @younesbelkada in #23698
is_batched fix for remaining 2-D numpy arrays by @LWprogramming in #23309
Skip TFCvtModelTest::test_keras_fit_mixed_precision for now by @ydshieh in #23699
fix: load_best_model_at_end error when load_in_8bit is True by @dkqkxx in #23443
Fix some docs what layerdrop does by @zspo in #23691
add GPTJ/bloom/llama/opt into model list and enhance the jit support by @sywangyi in #23291
Paged Optimizer + Lion Optimizer for Trainer by @TimDettmers in #23217
Export to ONNX doc refocused on using optimum, added tflite by @MKhalusova in #23434
fix: use bool instead of uint8/byte in Deberta/DebertaV2/SEW-D to make it compatible with TensorRT by @uchuhimo in #23683
fix gptj could not jit.trace in GPU by @sywangyi in #23317
Better TF docstring types by @Rocketknight1 in #23477
Minor awesome-transformers.md fixes by @pagarsky in #23453
TF SAM memory reduction by @Rocketknight1 in #23732
fix: delete duplicate sentences in document_question_answering.mdx by @jungnerd in #23735
fix: Whisper generate, move text_prompt_ids trim up for max_new_tokens calculation by @connor-henderson in #23724
Overhaul TF serving signatures + dummy inputs by @Rocketknight1 in #23234
[Whisper] Reduce batch size in tests by @sanchit-gandhi in #23736
Fix the regex in get_imports to support multiline try blocks and excepts with specific exception types by @dakinggg in #23725
Remove the last few TF serving sigs by @Rocketknight1 in #23738
Fix pip install --upgrade accelerate command in modeling_utils.py by @tloen in #23747
Fix psuh_to_hub in Trainer when nothing needs pushing by @sgugger in #23751
Revamp test selection for the example tests by @sgugger in #23737
[LongFormer] code nits, removed unused parameters by @ArthurZucker in #23749
Fix is_ninja_available() by @niltok in #23752
[Nllb-Moe] Fix nllb moe accelerate issue by @younesbelkada in #23758
[OPT] Doc nit, using fast is fine by @ArthurZucker in #23789
Fix RWKV backward on GPU by @sgugger in #23774
Update trainer.mdx class_weights example by @amitportnoy in #23787
no_cuda does not take effect in non distributed environment by @sywangyi in #23795
Fix no such file or directory error by @RissyRan in #23783
Enable code-specific revision for code on the Hub by @sgugger in #23799
add type hint in pipeline model argument by @y3sar in #23740
TF SAM shape flexibility fixes by @Rocketknight1 in #23842
fix Whisper tests on GPU by @hollance in #23753
🌐 [i18n-KO] Translated fast_tokenizers.mdx to Korean by @KIHOON71 in #22956
[i18n-KO] Translated video_classification.mdx to Korean by @KIHOON71 in #23026
🌐 [i18n-KO] Translated troubleshooting.mdx to Korean by @0525hhgus in #23166
Adds a FlyteCallback by @peridotml in #23759
Update collating_graphormer.py by @clefourrier in #23862
[LlamaTokenizerFast] nit update post_processor on the fly by @ArthurZucker in #23855
#23388 Issue: Update RoBERTa configuration by @vijethmoudgalya in #23863
[from_pretrained] imporve the error message when _no_split_modules is not defined by @ArthurZucker in #23861
Editing issue with pickle def with lambda function by @Natyren in #23869
Adds AutoProcessor.from_pretrained support for MCTCTProcessor by @Ubadub in #23856
🌐 [i18n-KO] Translated pad_truncation.mdx to Korean by @sim-so in #23823
Fix bug leading to missing token in GPTSanJapaneseTokenizer by @passaglia in #23883
Fix last instances of kbit -> quantized by @sgugger in #23797
fix(configuration_llama): add keys_to_ignore_at_inference to LlamaConfig by @calico-1226 in #23891
Fix Trainer when model is loaded on a different GPU by @sgugger in #23792
Support shared tensors by @thomasw21 in #23871
ensure banned_mask and indices in same device by @cauyxy in #23901
Unpin numba by @sanchit-gandhi in #23162
[bnb] add warning when no linear by @younesbelkada in #23894
fix: Replace add_prefix_space in get_prompt_ids with manual space for FastTokenizer compatibility by @connor-henderson in #23796
[RWKV] Fix RWKV 4bit by @younesbelkada in #23910
add conditional statement for auxiliary loss calculation by @harisankar95 in #23899
Raise error if loss can't be calculated - ViT MIM by @amyeroberts in #23872
Empty circleci config by @sgugger in #23913
Bug fix - flip_channel_order for channels first images by @amyeroberts in #23701
Re-enable squad test by @sgugger in #23912
Update the update metadata job to use upload_folder by @sgugger in #23917
[PushToHub] Make it possible to upload folders by @NielsRogge in #23920
Skip device placement for past key values in decoder models by @sgugger in #23919
[Flax Whisper] Update decode docstring by @sanchit-gandhi in #23908
Effectively allow encoder_outputs input to be a tuple in pix2struct by @fxmarty in #23932
Fix doc string nits by @sheonhan in #23929
Pin rhoknp by @sgugger in #23937
rename DocumentQuestionAnsweringTool parameter input to match docstring by @Adam-D-Lewis in #23939
Update stale.yml to use HuggingFaceBot by @LysandreJik in #23941
Make TF ESM inv_freq non-trainable like PyTorch by @Rocketknight1 in #23940
Revert "Update stale.yml to use HuggingFaceBot" by @LysandreJik in #23943
#23675 Registering Malay language by @soongbren in #23689
Modify device_map behavior when loading a model using from_pretrained by @SunMarc in #23922
use _make_causal_mask in clip/vit models by @kashif in #23942
Fix ReduceLROnPlateau object has no attribute 'get_last_lr' by @wasupandceacar in #23944
[MMS] Scaling Speech Technology to 1,000+ Languages | Add attention adapter to Wav2Vec2 by @patrickvonplaten in #23813
add new mms functions to doc by @patrickvonplaten in #23954
🌐 [i18n-KO] Translated object_detection.mdx to Korean by @KIHOON71 in #23164
Trainer: fixed evaluate raising KeyError for ReduceLROnPlateau by @claudius-kienle in #23952
[Whisper Tokenizer] Skip special tokens when decoding with timestamps by @sanchit-gandhi in #23945
Add an option to reduce compile() console spam by @Rocketknight1 in #23938
Added time-series blogs to the models by @elisim in #23857
Fix typo in doc comment of BitsAndBytesConfig by @ledyba in #23978
Skip test_multi_gpu_data_parallel_forward for MobileViTV2ModelTest by @ydshieh in #24017
Update README.md by @ydshieh in #24022
Auto tokenizer registration by @Bearnardd in #23965
expose safe_serialization argument in the pipeline API by @yessenzhar in #23775
Pix2Struct: fix wrong broadcast axis of attention mask in visual encoder by @affjljoo3581 in #23976
TensorBoard callback no longer adds hparams by @bri25yu in #23999
🌐 [i18n-KO] Translated tasks_explained.mdx to Korean by @0525hhgus in #23844
Fix MobileViTV2 checkpoint name by @ydshieh in #24018
Pin deepspeed to 0.9.2 for now by @ydshieh in #24024
🌐 [i18n-KO] Translated language-modeling.mdx by @wonhyeongseo in #23969
🌐 [i18n-KO] Translated bertology.mdx to Korean by @wonhyeongseo in #23968
Add check for tied parameters by @SunMarc in #24029
Fixing single candidate_label return. by @Narsil in #24023
Use TruncatedNormal from Keras initializers by @hvaara in #24036
Prevent ZeroDivisionError on trainer.evaluate if model and dataset are tiny by @tomaarsen in #24049
Modification of one text example file should trigger said test by @sgugger in #24051
Tiny fix for check_self_hosted_runner.py by @ydshieh in #24052
Reduce memory usage in TF building by @Rocketknight1 in #24046
Move TF building to an actual build() method by @Rocketknight1 in #23760
Use new parametrization based weight norm if available by @ezyang in #24030
bring back filtered_test_list_cross_tests.txt by @ydshieh in #24055
Fix device placement for model-parallelism in generate for encoder/de… by @sgugger in #24025
Remote code improvements by @sgugger in #23959
Generate: increase left-padding test atol by @gante in #23448
[Wav2Vec2] Fix torch srcipt by @patrickvonplaten in #24062
Add support for non-rust implemented tokenization for __getitem__ method. by @jacklanda in #24039
Support PEFT models when saving the model using trainer by @younesbelkada in #24073
[Hub] Add safe_serialization in push_to_hub by @younesbelkada in #24074
Fix is_optimum_neuron_available by @michaelbenayoun in #23961
[bnb] Fix bnb skip modules by @younesbelkada in #24043
Be nice to TF by @ydshieh in #24076
Make the TF dummies even smaller by @Rocketknight1 in #24071
[doc build] Use secrets by @mishig25 in #24079
Fix expected value in tests of the test fetcher by @sgugger in #24077
Update delete_doc_comment_trigger.yml by @mishig25 in #24084
Do not prepare lr scheduler as it as the right number of steps by @sgugger in #24088
Fix a tiny typo in WhisperForConditionalGeneration::generate docstring by @sadra-barikbin in #24045
[Trainer] Correct behavior of _load_best_model for PEFT models by @younesbelkada in #24103
The following contributors have made significant changes to the library over the last release:
fast_tokenizers.mdx to Korean (#22956)Fixes the package so non-Python files (like CUDA kernels) are properly included.
Fixes the package so non-Python files (like CUDA kernels) are properly included.
Reverts a regression in the FSDP integration. Add pip install transformers["agent"] to have all dependencies agents rely on. Fixes the documentation a
Reverts a regression in the FSDP integration.
Add pip install transformers["agent"] to have all dependencies agents rely on.
Fixes the documentation about agents.
This releases has three breaking changes compared to version v4.28.0.
Transformers Agent is a new API that lets you use the library and Diffusers by prompting an agent (which is a large language model) in natural language. That agent will then output code using a set of predefined tools, leveraging the appropriate (and state-of-the-art) models for the task the user wants to perform. It is fully multimodal and extensible by the community. Learn more in the docs
SAM (Segment Anything Model) was proposed in Segment Anything by Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alex Berg, Wan-Yen Lo, Piotr Dollar, Ross Girshick.
The model can be used to predict segmentation masks of any object of interest given an input image.
SAM] Correct arxiv link by @younesbelkada in #22886SAM] Change to facebook/sam-vit-base by @younesbelkada in #22891SAM] Add sam doc by @younesbelkada in #22984DocumentQuestionAnsweringPipeline only for fast ⚡ tokenizers by @ydshieh in #22745automatic-mask-generation pipeline for Segment Anything Model (SAM) by @ArthurZucker in #22840RWKV suggests a tweak in the traditional Transformer attention to make it linear. This way, the model can be used as recurrent network: passing inputs for timestamp 0 and timestamp 1 together is the same as passing inputs at timestamp 0, then inputs at timestamp 1 along with the state of timestamp 0 (see example below).
This can be more efficient than a regular Transformer and can deal with sentence of any length (even if the model uses a fixed context length for training).
The FocalNet model was proposed in Focal Modulation Networks by Jianwei Yang, Chunyuan Li, Xiyang Dai, Lu Yuan, Jianfeng Gao. FocalNets completely replace self-attention (used in models like ViT and Swin) by a focal modulation mechanism for modeling token interactions in vision. The authors claim that FocalNets outperform self-attention based models with similar computational costs on the tasks of image classification, object detection, and segmentation.
The Open-Llama model was proposed in Open-Llama project by community developer s-JoL.
The model is mainly based on LLaMA with some modifications, incorporating memory-efficient attention from Xformers, stable embedding from Bloom, and shared input-output embedding from PLAM. And the model is pre-trained on both Chinese and English, which gives it better performance on Chinese language tasks.
Assisted generation is a new technique that lets you speed up generation with large language models by using a smaller model as assistant. The assistant model will be the ones doing multiple forward pass while the LLM will merely validate the tokens proposed by the assistant. This can lead to speed-ups up to 10x!
To avoid duplicating the model code in multiple repos when using the code on the Hub feature, loading such models will now save in their config the repo in which the code is. This way there is one source of ground truth for code on the Hub models.
This releases has three breaking changes compared to version v4.28.0.
The first one focuses on fixing training issues for Pix2Struct. This slightly affects the results, but should result in the model training much better.
Pix2Struct] Attempts to fix training issues 🚨🚨🚨 by @younesbelkada in #23004The second one is aligning the ignore index in the LUKE model to other models in the library. This breaks the convention that models should stick to their original implementation, but it was necessary in order to align with other transformers in the library
Finally, the third breaking change aims to harmonize the training procedure for most of recent additions in transformers. It should be users' responsibility to fill_mask the padding tokens of the labels with the correct value. This PR addresses the issue that was raised by other architectures such as Luke or Pix2Struct
Blip] remove labels masking by @younesbelkada in #23024torch_dtype to str when saved_model=True in save_pretrained for TF models by @ydshieh in #22740training.mdx to Korean by @gabrielwithappy in #22670DS_BUILD_AIO=1 by @ydshieh in #22741Deta in #22437 by @ydshieh in #22750serving_output for TF composite models (encoder-decoder like models) by @ydshieh in #22743sequence_classification.mdx to Korean by @0525hhgus in #22655CpmAnt model by @ydshieh in #22766tutorial/proprecssing.mdx to Korean by @sim-so in #22578test_word_time_stamp_integration for Wav2Vec2ProcessorWithLMTest by @ydshieh in #22800custom_models.mdx to Korean by @HanNayeoniee in #22534_toctree.yml by @jungnerd in #22549tasks/translation.mdx to Korean by @wonhyeongseo in #22805LayoutLMv2 and LayoutLMv3 in some pipeline tests by @ydshieh in #22774PartialState as the device handler in the Trainer by @muellerzr in #22752auto_tutorial, training by @gabrielwithappy in #22796main by @ydshieh in #22823test_eos_token_id_int_and_list_top_k_top_sampling by @ydshieh in #22826accelerate@main in CI by @ydshieh in #22859is_symbolic_tensor predicate by @hvaara in #22878FillMaskPipelineTests by @ydshieh in #22894accelerate.mdx to Korean by @0525hhgus in #22830tasks/masked_language_modeling.mdx to Korean by @HanNayeoniee in #22838tasks/summarization.mdx to Korean by @sim-so in #22783test_codegen_sample_max_time as flaky by @ydshieh in #22953stride is too high in TokenClassificationPipeline by @boyleconnor in #22942_load_pretrained_model by @hanrui1sensetime in #22947run_scripts.mdx to Korean by @HanNayeoniee in #22793create_a_model doc to Korean by @gabrielwithappy in #22754accelerete@main in PyTorch Past CI jobs by @ydshieh in #22963DeepSpeed CI job link in Past CI by @ydshieh in #22967tasks/masked_language_modeling.mdx by @HanNayeoniee in #22965DocTest] Fix correct checkpoint by @younesbelkada in #22988serialization.mdx to Korean by @wonhyeongseo in #22806tasks/image_captioning.mdx to Korean by @sim-so in #22943token_classification.mdx to Korean by @0525hhgus in #22945PEFT] Add HFTracer support for PEFT by @younesbelkada in #23006Pix2Struct] Fix pix2struct doctest by @younesbelkada in #23023multilingual.mdx to Korean by @HanNayeoniee in #23008test_offline_mode_pipeline_exception by @ydshieh in #23022BridgeTowerModelTester by @ydshieh in #23029_test_xla_generate less flaky by @ydshieh in #22996model_sharing.mdx to Korean by @0525hhgus in #22991bigbird test file by @ydshieh in #23040BridgeTower by @ydshieh in #23039BioGPTForSequenceClassification by @awinml in #22253convnext init by @IMvision12 in #23078tasks/image_classification.mdx to Korean by @0525hhgus in #23048tasks/question_answering.mdx to Korean by @jungnerd in #23012tasks/zero_shot_image_classification.mdx to Korean by @HanNayeoniee in #23065torchscript.mdx to Korean by @sim-so in #23060Flava] Fix flava torch.distributed.nn.functional import all_gather issue by @younesbelkada in #23108Pix2Struct model to set Pix2StructTextModel to is_decoder=True by @gbarello-uipath in #23051Doctest] Fix pix2struct doctest by @younesbelkada in #23121X | Y syntax for HfArgumentParser for Python 3.10+ by @XuehaiPan in #23126_toctree.yml by @HanNayeoniee in #23112symbolic_trace by @regisss in #23105GPT-J] Fix causal mask dtype by @younesbelkada in #23147max_length warning when it is not set by @gante in #23139multiple_choice.mdx by @gabrielwithappy in #23064no_trainer scripts to pre-train Vision Transformers by @awinml in #23156logging_steps, eval_steps, and save_steps by @konstantinjdobler in #23235from_config by @DyeKuu in #23246tensorflow-probability in docker files by @ydshieh in #23260The following contributors have made significant changes to the library over the last release:
training.mdx to Korean (#22670)auto_tutorial, training (#22796)create_a_model doc to Korean (#22754)multiple_choice.mdx (#23064)sequence_classification.mdx to Korean (#22655)accelerate.mdx to Korean (#22830)token_classification.mdx to Korean (#22945)model_sharing.mdx to Korean (#22991)tasks/image_classification.mdx to Korean (#23048)tutorial/proprecssing.mdx to Korean (#22578)tasks/summarization.mdx to Korean (#22783)tasks/image_captioning.mdx to Korean (#22943)torchscript.mdx to Korean (#23060)custom_models.mdx to Korean (#22534)tasks/masked_language_modeling.mdx to Korean (#22838)run_scripts.mdx to Korean (#22793)tasks/masked_language_modeling.mdx (#22965)multilingual.mdx to Korean (#23008)tasks/zero_shot_image_classification.mdx to Korean (#23065)_toctree.yml (#23112)tasks/translation.mdx to Korean (#22805)serialization.mdx to Korean (#22806)BioGPTForSequenceClassification (#22253)no_trainer scripts to pre-train Vision Transformers (#23156)Fixes a regression for DETA models
Fixes a regression for DETA models
Adapt find_tied_parameters to handle breaking change in Accelerate by @sgugger in #22360
The LLaMA model was proposed in LLaMA: Open and Efficient Foundation Language Models. It is a collection of foundation language models ranging from 7B to 65B parameters. You can request access to the weights here then use the conversion script to generate a checkpoint compatible with Hugging Face
Pix2Struct is a pretrained image-to-text model for purely visual language understanding, which can be finetuned on tasks containing visually-situated language. Pix2Struct has been fine-tuned on various tasks and datasets, ranging from image captioning and visual question answering (VQA) over different inputs (books, charts, science diagrams) to captioning UI components, and others.
transformers by @younesbelkada in #22528MEGA proposes a new approach to self-attention with each encoder layer having a multi-headed exponential moving average in addition to a single head of standard dot-product attention, giving the attention mechanism stronger positional biases. This allows MEGA to perform competitively to Transformers on standard benchmarks including LRA while also having significantly fewer parameters. MEGA’s compute efficiency allows it to scale to very long sequences, making it an attractive option for long-document NLP tasks.
The model is a an optimized GPT2 model with support for Multi-Query Attention.
The mixture of experts version of the NLLB release has been added to the library.
NLLB-MoE Adds the moe model by @ArthurZucker in #22024bnb] Let's make serialization of int8 models possible by @younesbelkada in #22177You can now push 8bit models and/or load 8bit models directly from the Hub, save memory and load your 8bit models faster! An example repo here
Notes from the PR:
The BLIP image processor incorrectly passed in the dimensions to resize in the order (width, height). This is reordered to be correct.
In most cases, this won't have an effect as the default height and width are the same. However, this is not backwards compatible for custom configurations with different height, width settings and direct calls to the resize method with different height, width values.
The big problem was the prefix and suffix tokens of the NLLB tokenizer.
Previous behaviour:
>>> from transformers import NllbTokenizer
>>> tokenizer = NllbTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
>>> tokenizer("How was your day?").input_ids
[13374, 1398, 4260, 4039, 248130, 2, 256047]
>>> # 2: '</s>'
>>> # 256047 : 'eng_Latn'
New behaviour
>>> from transformers import NllbTokenizer
>>> tokenizer = NllbTokenizer.from_pretrained("facebook/nllb-200-distilled-600M")
>>> tokenizer("How was your day?").input_ids
[256047, 13374, 1398, 4260, 4039, 248130, 2]
In case you have pipelines that were relying on the old behavior, here is how you would enable it once again:
>>> from transformers import NllbTokenizer
>>> tokenizer = NllbTokenizer.from_pretrained("facebook/nllb-200-distilled-600M", legacy_behaviour = True)
[NLLB Tokenizer] Fix the prefix tokens 🚨🚨🚨 by @ArthurZucker in #22313The BLIP model is now available in TensorFlow.
As the title says, this PR adds the possibility to export TF generate with a TF-native tokenizer -- the full thing in a single TF graph.
A new task guide has been added, focusing on depth-estimation.
MgpstrModelIntegrationTest by @ydshieh in #22195XGLM] Add accelerate support for XGLM by @younesbelkada in #22207dash==2.8.1 for now for daily CI by @ydshieh in #22227dash==2.8.1 for now for daily CI" by @ydshieh in #22233TFCvtModel by @gcuder in #22267max_memory for device_map strategies by @sgugger in #22311generate(synced_gpus=True, ...) by @stas00 in #22242MBart] Add accelerate support for MBart by @younesbelkada in #22309torch<1.10 by @stas00 in #22370cmake dependencies in CI by @gante in #22383bnb] Force requires_grad to be False by @younesbelkada in #22396causal_mask is created directly on device by @jeffra in #22378bnb] fix bnb failing test by @younesbelkada in #22439Generate] Add conditional generation for multimodal models by @younesbelkada in #22424Pix2Struct] Fix slow test by @younesbelkada in #22448model_type update for auto mapping by @ArthurZucker in #22470max_position_embeddings by @gante in #22471eos_token_id < 0 checks in generate() from ValueError to warning by @lewtun in #22472Wav2Vec2ProcessorWithLM doc example by @ydshieh in #22474TextIteratorStreamer (streamer for gradio) by @gante in #22501Trainer] Force is_model_parallel when model is loaded in multiple GPUs using accelerate by @younesbelkada in #22532T5] Enable naive Pipeline Parallelism training for T5 by @younesbelkada in #22535distutils usage by @XuehaiPan in #22531pyproject.toml by @XuehaiPan in #22539bnb] Fix typo by @younesbelkada in #22556_no_split_modules for Whisper model by @pacman100 in #22486TextIteratorStreamer timeout by @gante in #22576accelerate_tests mark warnings by @gante in #22585_toctree.yml by @wonhyeongseo in #22581pipeline_model_mapping systematically by @ydshieh in #22180bnb] 8bit models should not be converted to DDP by @younesbelkada in #22628Blip] Fix slow tests and doctests with correct values by @younesbelkada in #22632autoclass_tutorial to Korean and Fix the typo of quicktour by @gabrielwithappy in #22533MegaModel CI by @ydshieh in #22652pipeline_tutorial.mdx to Korean by @wonhyeongseo in #22508MarkupLM tests' expected values by @ydshieh in #22667torch.distributed group initialization for torch_neuron disabled when optimum-neuron is installed by @michaelbenayoun in #22728The following contributors have made significant changes to the library over the last release:
_toctree.yml (#22581)pipeline_tutorial.mdx to Korean (#22508)This patch fixes a regression with FlauBERT and XLM models.
This patch fixes a regression with FlauBERT and XLM models.
Enforce max_memory for device_map strategies by @sgugger in #22311
Enforce max_memory for device_map strategies by @sgugger in #22311
Fix balanced and auto device_map by @sgugger in #22271
Patches two unwanted breaking changes that were released in v4.27.0:
Patches two unwanted breaking changes that were released in v4.27.0:
This PR deprecated the parallelize API which has been replaced by accelerate months ago. We recommend loading the model using the device_map attribute…
The goal of this model is to build a bridge between each uni-modal encoder and the cross-modal encoder to enable comprehensive and detailed interaction at each layer of the cross-modal encoder thus achieving remarkable performance on various downstream tasks with almost negligible additional performance and computational costs.
The Whisper model was integrated a few releases ago. This release offers significant performance optimizations when generating with timestamps. This was made possible by rewriting the generate() function of Whisper, which now uses the generation_config and implementing a batched timestamp prediction. The language and task can now also be setup when calling generate(). For more details about this refactoring checkout this colab.
Notably, whisper is also now supported in Flax 🚀 thanks to @andyehrenberg ! More whisper related commits:
WhisperModelTest by @ydshieh in #21883do_normalize by @ArthurZucker in #21263model_split_percents for WhisperModelTest by @ydshieh in #21922WhisperFeatureExtractor by @bofenghuang in #21938WhisperEncoderModelTest by @ydshieh in #22060Whiper] add get_input_embeddings to WhisperForAudioClassification by @younesbelkada in #22133DETA (short for Detection Transformers with Assignment) improves Deformable DETR by replacing the one-to-one bipartite Hungarian matching loss with one-to-many label assignments used in traditional detectors with non-maximum suppression (NMS). This leads to significant gains of up to 2.5 mAP.
The SpeechT5 framework consists of a shared encoder-decoder network and six modal-specific (speech/text) pre/post-nets. After preprocessing the input speech/text through the pre-nets, the shared encoder-decoder network models the sequence-to-sequence transformation, and then the post-nets generate the output in the speech/text modality based on the output of the decoder.
XLM-V is multilingual language model with a one million token vocabulary trained on 2.5TB of data from Common Crawl (same as XLM-R).
BLIP-2 leverages frozen pre-trained image encoders and large language models (LLMs) by training a lightweight, 12-layer Transformer encoder in between them, achieving state-of-the-art performance on various vision-language tasks. Most notably, BLIP-2 improves upon Flamingo, an 80 billion parameter model, by 8.7% on zero-shot VQAv2 with 54x fewer trainable parameters.
X-MOD extends multilingual masked language models like XLM-R to include language-specific modular components (language adapters) during pre-training. For fine-tuning, the language adapters in each transformer layer are frozen.
ERNIE-M is a new training method that encourages the model to align the representation of multiple languages with monolingual corpora, to overcome the constraint that the parallel corpus size places on the model performance.
The Textless Vision-Language Transformer (TVLT) is a model that uses raw visual and audio inputs for vision-and-language representation learning, without using text-specific modules such as tokenization or automatic speech recognition (ASR). It can perform various audiovisual and vision-language tasks like retrieval, question answering, etc.
CLAP (Contrastive Language-Audio Pretraining) is a neural network trained on a variety of (audio, text) pairs. It can be instructed in to predict the most relevant text snippet, given an audio, without directly optimizing for the task. The CLAP model uses a SWINTransformer to get audio features from a log-Mel spectrogram input, and a RoBERTa model to get text features. Both the text and audio features are then projected to a latent space with identical dimension. The dot product between the projected audio and text features is then used as a similar score.
CLAP] Fix few broken things by @younesbelkada in #21670GPTSAN is a Japanese language model using Switch Transformer. It has the same structure as the model introduced as Prefix LM in the T5 paper, and support both Text Generation and Masked Language Modeling tasks. These basic tasks similarly can fine-tune for translation or summarization.
EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models.
ALIGN is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image classification. ALIGN features a dual-encoder architecture with EfficientNet as its vision encoder and BERT as its text encoder, and learns to align visual and text representations with contrastive learning. Unlike previous work, ALIGN leverages a massive noisy dataset and shows that the scale of the corpus can be used to achieve SOTA representations with a simple recipe.
Informer is a method to be applied to long-sequence time-series forecasting. This method introduces a Probabilistic Attention mechanism to select the “active” queries rather than the “lazy” queries and provides a sparse Transformer thus mitigating the quadratic compute and memory requirements of vanilla attention.
safetensors is a safe format of serialization of tensors, which has been supported in transformers as a first-class citizen for the past few versions.
This change enables explicitly forcing the from_pretrained method to use or not to use safetensors. This unlocks a few use-cases, notably the possibility to enforce loading only from this format, limiting security risks.
Example of usage:
from transformers import AutoModel
# As of version v4.27.0, this loads the `pytorch_model.bin` by default if `safetensors` is not installed.
# It loads the `model.safetensors` file if `safetensors` is installed.
model = AutoModel.from_pretrained('bert-base-cased')
# This forces the load from the `model.safetensors` file.
model = AutoModel.from_pretrained('bert-base-cased', use_safetensors=True)
# This forces the load from the `pytorch_model.bin` file.
model = AutoModel.from_pretrained('bert-base-cased', use_safetensors=False)
This PR adds a "variant" keyword argument to PyTorch's from_pretrained and save_pretrained so that multiple weight variants can be saved in the model repo.
Example of usage with the model hosted in this folder on the Hub:
from transformers import CLIPTextModel
path = "huggingface/the-no-branch-repo" # or ./text_encoder if local
# Loads the `no_ema` variant. This loads the `pytorch_model.fp16.bin` file from this folder.
model = CLIPTextModel.from_pretrained(path, subfolder="text_encoder", variant="fp16")
# This loads the no-variant checkpoint, loading the `pytorch_model.bin` file from this folder.
model = CLIPTextModel.from_pretrained(path, subfolder="text_encoder")
The bitsandbytes integration is overhauled, now offering a new configuration: the BytsandbytesConfig.
Read more about it in the documentation.
bnb] Introducing BitsAndBytesConfig by @younesbelkada in #21579bnb] fix bnb decoders bug by @younesbelkada in #21688This PR enables the user to make use of the PyTorch/XLA implementation of FSDP, including the newly added auto-wrap feature. Four arguments have been added to training_args.py to facilitate this functionality:
xla_fsdp: this flag is a string containing the location of a .json file which specifies the FSDP arguments the user wants to use when wrapping their model.xla_fsdp_min_num_params: this flag is an int which will set a size-based automatic wrapping policy which automatically FSDP wraps any module with at least xla_fsdp_min_num_params many parameters.xla_fsdp_transformer_layer_cls_to_wrap: this flag is a list of (case-sensitive) strings which will set a layer-class-based automatic wrapping policy which automatically FSDP wraps any module whose name matches one of the listed strings.xla_fsdp_grad_ckpt: this flag is a bool which determines whether gradient checkpointing is enabled for the automatically wrapped layers.Generate
This PR standardizes beam search behavior across all three frameworks through early_stopping. PyTorch is unchanged, but TensorFlow and Flax users will see a significant speedup if they keep the default generation parameters.
There are, however, minor differences in outputs of the .generate method with beam search on TensorFlow and Flax. It should be very small and will come with significant speedups, but in case it breaks your workflow, we recommend you downgrade to a previous version and let us know in a GitHub issue so that we may investigate what is going on.
Single model initialization
Model initialization has problems which led to the initialization being incoherent across models and across initialization techniques. This is technically a bugfix, but as it may result in your models being initialized with different values, we think it best to highlight it here.
This PR deprecated the parallelize API which has been replaced by accelerate months ago. We recommend loading the model using the device_map attribute and setting it to balanced to obtain the previous behavior.
Setting your own device_map is still permitted, but it needs to be a dictionary from module name to device, for example:
device_map = {'h.0': 0, 'h.1': 1, ...}
A new pipeline focused on zero-shot audio classification is added to the repository.
The task and model summaries have been refactored to take into account the larger number of tasks and models we now have.
t5] Fix T5 inference in float16 + bnb error by @younesbelkada in #21281TrainingArguments.label_names docs to reflect the correct default value behaviour by @fredtcaroli in #21288ImageProcessor in place of FeatureExtractor for pipelines by @Narsil in #20851oneformer. by @Narsil in #21292EfficientFormer by @ydshieh in #21294OneFormerModelIntegrationTest expected values by @ydshieh in #21295Blenderbot doctest by @younesbelkada in #21297past in prepare inputs for generation by @ArthurZucker in #21296model_class.__name__ and compare against XXX_MAPPING_NAMES by @ydshieh in #21304utils/documentation_tests.txt by @ydshieh in #21315TFEncoderDecoder tests by @ydshieh in #21301compute_transition_scores examples by @gante in #21323Perceiver doctest by @younesbelkada in #21318RobertaPreLayerNorm doctest by @ydshieh in #21337GitModelIntegrationTest.test_batched_generation device issue by @ydshieh in #21362max_length and max_new_tokens coexistence by @gante in #21347run_(clm|mlm).py examples] add streaming dataset support by @stas00 in #21343layer_norm_eps in some models by @ydshieh in #21336max_position_embeddings or max_target_positions by @gante in #21389Graphormer and fix its torchscript test failures by @ydshieh in #21380inputs_embeds by @gante in #214051.13.1 in push/schedule CI by @ydshieh in #21421bnb] Fine-tuning HF 8-bit models by @younesbelkada in #21290is_flaky by @ydshieh in #21426inputs_embeds support for .generate() with BLOOM models by @akreal in #21430ConvBertModelTest test by @ydshieh in #21438SpeechT5ForSpeechToSpeechIntegrationTests device issue by @ydshieh in #21460PushToHubCallback import in Share a model docs by @ireneisdoomed in #21457more_itertools dependency. by @Narsil in #21473prepare_inputs_for_generation by @gante in #21477past in favor of pat_key_values by @ArthurZucker in #21443Doc] Fix int8 docs by @younesbelkada in #21487GPT2TokenizerFast to the list of tokenizer to use for OPT. by @ArthurZucker in #20823compute_transition_scores by @gante in #21341report_to none by @stas00 in #21505image_processor in pipeline. by @Narsil in #21513eos_token_ids in model.generate(...) by @tokestermw in #21461__len__ method to _LazyAutoMapping by @ydshieh in #21522.generate() signature == PT .generate() signature by @gante in #21525.generate() can now be exported with dynamic length by @gante in #21474pipeline] A simple fix for half-precision & 8bit models by @younesbelkada in #21479torch_dtype="auto" to look up config.torch_dtype first, expand docs by @stas00 in #21524config.hidden_size by @stas00 in #21504Blip2] Add int8 support for blip2-flan-t5-xxl by @younesbelkada in #21574inputs_embeds support when generating with GPT-J by @dimitry12 in #21575test_constrained_beam_search_generate_dict_output by @gante in #21561bnb] Let's make the daily CI green 🍏 by @younesbelkada in #21597requires_grad on input embedding to train on top of frozen layers by @younesbelkada in #21598max_length is reached." from InfNaNLogitsProcessor documentation by @mmcdermott in #21634ImageProcessor] Refactor default mean & std to OPENAI_CLIP_MEAN & OPENAI_CLIP_STD by @younesbelkada in #21425BLIP] update blip path on slow tests by @younesbelkada in #21476PROCESSOR_MAPPING_NAMES and add tests by @ydshieh in #21703get_class_in_module by @ydshieh in #21709MBart] Fix cross attention mask check by @younesbelkada in #21730gptsan_japanese from doctest list to avoid GPU OOM by @ydshieh in #21722BigBirdForQuestionAnswering by @ydshieh in #21723ErnieMEmbeddings device issue by @ydshieh in #21726GPTSanJapaneseModel by @ydshieh in #21731GPTNeo] Fix gradient checkpointing bug by @younesbelkada in #21733max_length and num_beams by @bofenghuang in #21740concrete_args from outside available by @lygztq in #21775tests] add accelerate marker by @younesbelkada in #21743PerceiverFourierPositionEncoding with fp16 by @fxmarty in #21787ruff==0.0.253 by @ydshieh in #21828logger.warning_once and use it for grad checkpointing code by @stas00 in #21804MobileViTModelTest to TFMobileViTModelTest by @ydshieh in #21825T5] Fix torchquant issue by @younesbelkada in #21843Blip2] Add Blip2Model by @younesbelkada in #21817Blip2] Fix Blip-2 multi gpu by @younesbelkada in #21707PipelineTestCaseMeta 🚀 by @ydshieh in #21516Blip] Fix blip doctest by @younesbelkada in #21868test_load_default_pipelines_pt for ClapModel by @ydshieh in #21886inputs_embeds functionality when generating with BioGPT by @sidkiblawi in #21889d_kv by @ArthurZucker in #21896BridgeTowerModelTest by @ydshieh in #21908repo_utils_job by @ydshieh in #21928AlignModelTest tests by @ydshieh in #21923check_repo.py due to missing backends by @ydshieh in #21930XLMProphetNetModelIntegrationTest by @ydshieh in #21957torch.allclose for some tests by @ydshieh in #21966test_xglm_sample by @ydshieh in #21975Jukebox tests by @ydshieh in #21984notification_service.py by @ydshieh in #21992test_multi_gpu_data_parallel_forward for some model tests by @ydshieh in #21991AudioClassificationPipelineTests::test_small_model_pt for PT 2.0.0 by @ydshieh in #22023bnb] Fix bnb error message by @younesbelkada in #22026text_config_dict and vision_config_dict being saved for CLIP-like models by @ydshieh in #22035BridgeTower tests slow for now by @ydshieh in #22039huggingface_hub warnings in CI report by @ydshieh in #22054image_processing_donut to match code by @vermouthmjl in #22033Blip2] skip accelerate test by @younesbelkada in #22124is_pipeline_test_to_skip to specific model test classes by @ydshieh in #21999--optim adamw_torch_fused for pt-2.0+ by @stas00 in #22144The following contributors have made significant changes to the library over the last release:
ESM openfold_utils type hints by @ringohoffman in #20544
In the vision integration, all feature extractor classes have been deprecated to be renamed to ImageProcessor. The old feature extractors will be full…
GenerationConfigThe generate method has multiple arguments whose defaults were lying in the model config. We have now decoupled these in a separate generation config, which makes it easier to store different sets of parameters for a given model, with different generation strategies. While we will keep supporting generate arguments in the model configuration for the foreseeable future, it is now recommended to use a generation config. You can learn more about its uses here and its documentation here.
GenerationConfig as the basis for .generate() parametrization by @gante in #20388GenerationConfig as the basis for .generate() parametrization by @gante in #20994GenerationConfig as the basis for .generate() parametrization by @gante in #21007ImageProcessorIn the vision integration, all feature extractor classes have been deprecated to be renamed to ImageProcessor. The old feature extractors will be fully removed in version 5 of Transformers and new vision models will only implement the ImageProcessor class, so be sure to switch your code to this new name sooner rather than later!
AltCLIP is a variant of CLIP obtained by switching the text encoder with a pretrained multilingual text encoder (XLM-Roberta). It has very close performances with CLIP on almost all tasks, and extends the original CLIP’s capabilities to multilingual understanding.
BLIP is a model that is able to perform various multi-modal tasks including visual question answering, image-text retrieval (image-text matching) and image captioning.
BioGPT is a domain-specific generative pre-trained Transformer language model for biomedical text generation and mining. BioGPT follows the Transformer language model backbone, and is pre-trained on 15M PubMed abstracts from scratch.
BiT is a simple recipe for scaling up pre-training of ResNet-like architectures (specifically, ResNetv2). The method results in significant improvements for transfer learning.
EfficientFormer proposes a dimension-consistent pure transformer that can be run on mobile devices for dense prediction tasks like image classification, object detection and semantic segmentation.
GIT is a decoder-only Transformer that leverages CLIP’s vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on image captioning and visual question answering benchmarks.
GPT-Sw3 is a collection of large decoder-only pretrained transformer language models that were developed by AI Sweden in collaboration with RISE and the WASP WARA for Media and Language. GPT-Sw3 has been trained on a dataset containing 320B tokens in Swedish, Norwegian, Danish, Icelandic, English, and programming code. The model was pretrained using a causal language modeling (CLM) objective utilizing the NeMo Megatron GPT implementation.
Graphormer is a Graph Transformer model, modified to allow computations on graphs instead of text sequences by generating embeddings and features of interest during preprocessign and collation, then using a modified attention.
Mask2Former is a unified framework for panoptic, instance and semantic segmentation and features significant performance and efficiency improvements over MaskFormer.
OneFormer is a universal image segmentation framework that can be trained on a single panoptic dataset to perform semantic, instance, and panoptic segmentation tasks. OneFormer uses a task token to condition the model on the task in focus, making the architecture task-guided for training, and task-dynamic for inference.
The RoBERTa-PreLayerNorm model is identical to RoBERTa but uses the --encoder-normalize-before flag in fairseq.
Swin2R improves the SwinIR model by incorporating Swin Transformer v2 layers which mitigates issues such as training instability, resolution gaps between pre-training and fine-tuning, and hunger on data.
TimeSformer is the first video transformer. It inspired many transformer based video understanding and classification papers.
UPerNet is a general framework to effectively segment a wide range of concepts from images, leveraging any vision backbone like ConvNeXt or Swin.
ViT hybrid is a slight variant of the plain Vision Transformer, by leveraging a convolutional backbone (specifically, BiT) whose features are used as initial “tokens” for the Transformer. It’s the first architecture that attains similar results to familiar convolutional architectures.
Breaking a bit the one model per file policy, we introduce backbones (mainly for vision models) which can then be re-used in more complex models like DETR, MaskFormer, Mask2Former etc.
BeitDropPath layers by @younesbelkada in #20587natten with CUDA version by @ydshieh in #20546FEATURE_EXTRACTOR_MAPPING_NAMES by @ydshieh in #20551require_torch to 2 pipeline tests by @ydshieh in #20585tensorflow_probability for TF pipeline CI by @ydshieh in #20586classifier_dropout in config by @ydshieh in #20596set-output by $GITHUB_OUTPUT by @ydshieh in #20547.to function for ImageProcessors by @younesbelkada in #20536AutomaticSpeechRecognitionPipelineTests.run_pipeline_test by @ydshieh in #20597natten installation in docker file by @ydshieh in #206328bitmodels by @younesbelkada in #20651ViTHybrid] + [BiT] cleaner __init__ by @younesbelkada in #20649run_pipeline_test by @ydshieh in #20623dpt-hybrid support by @younesbelkada in #20645BiT] Small patch fix by @younesbelkada in #20657BackboneMixin by @ydshieh in #20660ViTHybrid] Fix accelerate slow tests by @younesbelkada in #20679test_tokenization_led by @IMvision12 in #20568test_multi_gpu_data_parallel_forward for MaskFormerSwinModelTest by @ydshieh in #20688ViTHybrid] fix last accelerate slow test by @younesbelkada in #20705accelerate support for LongT5 models by @pszemraj in #20341AutoModelTest.test_model_from_pretrained by @ydshieh in #20730layoutlm_job to exotic_models_job by @ydshieh in #20736keep_in_fp32_modules support by @younesbelkada in #20683torch_tensorrt in DeepSpeed CI image for now by @ydshieh in #20758() in some usage of is_flaky by @ydshieh in #20749torch-tensorrt 1.3.0 for DeepSpeed CI by @ydshieh in #20764pipeline test by @younesbelkada in #20778layoutlm by @Narsil in #20776apex in DeepSpeed CI image by @ydshieh in #20788IMAGE_PROCESSOR_MAPPING by @younesbelkada in #20790sentencepiece in DeepSpeed CI image by @ydshieh in #20795Vision] [Refactor] Initialize weights on the correct place by @younesbelkada in #20803max_position_embeddings in config classes by @ydshieh in #20836use_cache in config classes by @ydshieh in #20844use_fast parameter in docstring by @stevhliu in #20840config.num_channels in CLIP-like modeling files by @ydshieh in #20857evaluate to the list of libraries required in generated notebooks by @MKhalusova in #20850LevitModelTest.test_problem_types by @ydshieh in #20859HubertModelIntegrationTest.test_inference_keyword_spotting by @ydshieh in #20863FSMT] Make it compatible with xxxForConditionalGeneration models by @younesbelkada in #20825MobileNet-v2] Fix ONNX typo by @younesbelkada in #20860fp16 for asr pipeline. by @Narsil in #20864T5] fix fp16 loading issue by @younesbelkada in #20878WhisperFeatureExtractor by @bofenghuang in #20936distributed_concat] ensure all_gather's inputs are contiguous by @stas00 in #20951AutomaticSpeechRecognitionPipeline by @bofenghuang in #20952_reorder_cache by @gante in #20964MinNewTokensLengthLogitsProcessor for .generate method #20814 by @kotikkonstantin in #20892decoder_attention_mask in generate function by @samuelpullely in #20726BLIP] Fix daily CI failing test by @younesbelkada in #20877past with past_key_values by @ArthurZucker in #20944documentation_tests.txt by @ydshieh in #21036torchscript tests for AltCLIP by @ydshieh in #21102min_new_tokens argument in generate() (implementation based on MinNewTokensLengthLogitsProcessor) by @silverriver in #21044RealmModelIntegrationTest.test_inference_open_qa by @ydshieh in #21136TFTapasEmbeddings by @ydshieh in #21107use_cache from model_kwargs by @gante in #21149installation.mdx to Korean by @wonhyeongseo in #20948test_save_pretrained_signatures slow test by @ydshieh in #21105blip support for training by @younesbelkada in #21021Mask2FormerForUniversalSegmentation by @ydshieh in #21175UperNetModelIntegrationTest by @ydshieh in #21192CVT] Fix module initialization issue by @younesbelkada in #21193automatic-speech-recognition asr for Whisper. by @Narsil in #21196huggingface_hub version by @ydshieh in #21212CONFIG_ARCHIVE_MAP_MAPPING_NAMES by @ydshieh in #21207GPTJ doctest by @ydshieh in #21213parallelism for CircleCI jobs work - but keep it 1 for now by @ydshieh in #21157BLIP] fix docstring for BlipTextxxx by @younesbelkada in #21224BLIP] fix doctest by @younesbelkada in #21217.save_pretrained() by @gante in #21264The following contributors have made significant changes to the library over the last release:
[Proposal] Breaking change zero-shot-object-detection for improved consistency. by @Narsil in #20280
We are very excited by the newly announced PyTorch 2.0 stack. You can enable torch.compile on any of our models, and get support with the Trainer (and in all our PyTorch examples) by using the torchdynamo training argument. For instance, just add --torchdynamo inductor when launching those examples from the command line.
This API is still experimental and may be subject to changes as the PyTorch 2.0 stack matures.
Note that to get the best performance, we recommend:
--pad_to_max_length in our examples)The Audio Spectrogram Transformer model was proposed in AST: Audio Spectrogram Transformer by Yuan Gong, Yu-An Chung, James Glass. The Audio Spectrogram Transformer applies a Vision Transformer to audio, by turning audio into an image (spectrogram). The model obtains state-of-the-art results for audio classification.
The Jukebox model was proposed in Jukebox: A generative model for music by Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, Ilya Sutskever. It introduces a generative music model which can produce minute long samples that can be conditionned on an artist, genres and lyrics.
The SwitchTransformers model was proposed in Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity by William Fedus, Barret Zoph, Noam Shazeer.
It is the first MoE model supported in transformers, with the largest checkpoint currently available currently containing 1T parameters.
The RoCBert model was proposed in RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining by HuiSu, WeiweiShi, XiaoyuShen, XiaoZhou, TuoJi, JiaruiFang, JieZhou. It’s a pretrained Chinese language model that is robust under various forms of adversarial attacks.
The CLIPSeg model was proposed in Image Segmentation Using Text and Image Prompts by Timo Lüddecke and Alexander Ecker. CLIPSeg adds a minimal decoder on top of a frozen CLIP model for zero- and one-shot image segmentation.
NAT was proposed in Neighborhood Attention Transformer by Ali Hassani, Steven Walton, Jiachen Li, Shen Li, and Humphrey Shi.
It is a hierarchical vision transformer based on Neighborhood Attention, a sliding-window self attention pattern.
DiNAT was proposed in Dilated Neighborhood Attention Transformer by Ali Hassani and Humphrey Shi.
It extends NAT by adding a Dilated Neighborhood Attention pattern to capture global context, and shows significant performance improvements over it.
The MobileNet model was proposed in MobileNetV2: Inverted Residuals and Linear Bottlenecks by Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen.
The MobileNet model was proposed in MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications by Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam.
Image processors replace feature extractors as the processing class for computer vision models.
Important changes:
size parameter is now a dictionary of {"height": h, "width": w}, {"shortest_edge": s}, {"shortest_egde": s, "longest_edge": l} instead of int or tuple.data_format flag. You can now specify if you want your images to be returned in "channels_first" - NCHW - or "channels_last" - NHWC - format.do_resize can be passed directly to the preprocess method instead of modifying the class attribute: image_processor([image_1, image_2], do_resize=False, return_tensors="pt", data_format="channels_last")return_tensors unset will return a list of numpy arrays.The classes are backwards compatible and can be created using existing feature extractor configurations - with the size parameter converted.
We're adding support for a general AutoBackbone class, which turns any vision model (like ConvNeXt, Swin Transformer) into a backbone to be used with frameworks like DETR and Mask R-CNN. The design is in early stages and we welcome feedback.
safetensors offloadingIf the model you are using has a safetensors checkpoint and you have the library installed, offload to disk will take advantage of this to be more memory efficient and roughly 33% faster.
generate methodconvert_tokens_to_string by @beneyal in #15775tokenizer_type to avoid error when loading checkpoint back by @pacman100 in #20062VisionTextDualEncoderProcessorTest by @ydshieh in #20098generate_dummy_inputs for ImageGPTOnnxConfig by @ydshieh in #20103CLIPSegModelTester by @ydshieh in #20134_keys_to_ignore. by @Narsil in #20042RoCBertTokenizer to TOKENIZER_MAPPING_NAMES by @ydshieh in #20141object-detection. by @Narsil in #20143OnnxConfig.generate_dummy_inputs to check ImageProcessingMixin by @ydshieh in #20157inspect in ASR pipeline and make WhisperEncoder just nice to use. by @Narsil in #19571test_save_load_fast_init_from_base as is_flaky by @ydshieh in #20200ImageSegmentationPipelineTests less flaky by @ydshieh in #20147accelerate support for ViT family by @younesbelkada in #20174authorized_missing_keysin favor of _keys_to_ignore_on_load_missing by @ArthurZucker in #20228run_clip.py by @ydshieh in #20234audio-classification example in the doc. by @Narsil in #20235fill-mask pipeline. by @Narsil in #20241feature-extraction. by @Narsil in #20240depth-estimation pipeline. by @Narsil in #20237table-question-answering pipeline. by @Narsil in #20260image-segmentation pipeline. by @Narsil in #20256text2text-generation pipeline. by @Narsil in #20261text-generation pipeline. by @Narsil in #20264image-classification pipeline. by @Narsil in #20254zero-shot-image-classification pipeline. by @Narsil in #20272zero-shot-classification pipeline. by @Narsil in #20268visual-question-answering pipeline. by @Narsil in #20266text-classification pipeline. by @Narsil in #20262question-answering pipeline. by @Narsil in #20259image-to-text pipeline. by @Narsil in #20257token-classification pipeline. by @Narsil in #20265zero-shot-object-detection pipeline doctest. by @Narsil in #20274object-detection pipeline. by @Narsil in #20258PushToHubCallback by @gante in #20231ImageProcessor by @ydshieh in #20298zero-shot-object-detection for improved consistency. by @Narsil in #20280model_kwargs can also be an input to prepare_inputs_for_generation by @gante in #20353keys_to_ignore for M2M100 by @younesbelkada in #20381accelerate support for ESM by @younesbelkada in #20379accelerate tests for esmfold by @younesbelkada in #20387bnb bug by @younesbelkada in #20408ValueError when trying to cast or assign by @younesbelkada in #20409model_max_length when saving tokenizers by @ydshieh in #20401accelerate support for OwlViT by @younesbelkada in #20411word_to_tokens docstring format by @SaulLu in #20450CLIPSegModelIntegrationTest by @ydshieh in #20467contrastive_loss by @ydshieh in #20455attention_mask truncation in whisper by @ydshieh in #20488add_special_tokens more clear by @ydshieh in #20424galactica models by @younesbelkada in #20390AutomaticSpeechRecognitionPipeline doc example by @ydshieh in #20512natten for CI by @ydshieh in #20511PLBart doctest by @ydshieh in #20527ConditionalDetrForSegmentation doc example by @ydshieh in #20531ZeroShotObjectDetectionPipeline doc example by @ydshieh in #20528The following contributors have made significant changes to the library over the last release:
Nothing published for this version
The following changes are bugfixes that we have chosen to fix even if it changes the resulting behavior. We mark them as breaking changes, so if you a…
ESM-2 and ESMFold are new state-of-the-art Transformer protein language and folding models from Meta AI's Fundamental AI Research Team (FAIR). ESM-2 is trained with a masked language modeling objective, and it can be easily transferred to sequence and token classification tasks for proteins. Checkpoints exist in various sizes, from 8 million parameters up to a huge 15 billion parameter model.
ESMFold is a state-of-the-art single sequence protein folding model which produces high accuracy predictions significantly faster. Unlike previous protein folding tools like AlphaFold2 and openfold, ESMFold uses a pretrained protein language model to generate token embeddings that are used as input to the folding model, and so does not require a multiple sequence alignment (MSA) of related proteins as input. As a result, proteins can be folded in a single forward pass of the model without requiring any external databases or search/alignment tools to be present at inference time. This hugely reduces the time and compute requirements for folding.
Transformer protein language models were introduced in the paper Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences by Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, C. Lawrence Zitnick, Jerry Ma, and Rob Fergus.
ESMFold was introduced in the paper Language models of protein sequences at the scale of evolution enable accurate structure prediction by Zeming Lin, Halil Akin, Roshan Rao, Brian Hie, Zhongkai Zhu, Wenting Lu, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido, and Alexander Rives.
LiLT allows to combine any pre-trained RoBERTa text encoder with a lightweight Layout Transformer, to enable LayoutLM-like document understanding for many languages.
It was proposed in LiLT: A Simple yet Effective Language-Independent Layout Transformer for Structured Document Understanding by Jiapeng Wang, Lianwen Jin, Kai Ding.
FLAN-T5 is an enhanced version of T5 that has been finetuned on a mixture of tasks.
It was released in the paper Scaling Instruction-Finetuned Language Models by Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei.
flan-t5 documentation page by @younesbelkada in #19892Table Transformer is a model that can perform table extraction and table structure recognition from unstructured documents based on the DETR architecture.
It was proposed in PubTables-1M: Towards comprehensive table extraction from unstructured documents by Brandon Smock, Rohith Pesala, Robin Abraham.
Contrastive search decoding is a new state-of-the-art generation method which aims at reducing the repetitive patterns in which generation models often fall.
It was introduced in A Contrastive Framework for Neural Text Generation by Yixuan Su, Tian Lan, Yan Wang, Dani Yogatama, Lingpeng Kong, Nigel Collier.
We continue to explore the new serialization format not using Pickle via the safetensors library, this time by adding support for TensorFlow models. More checkpoints have been converted to this format. Support is still experimental.
The following changes are bugfixes that we have chosen to fix even if it changes the resulting behavior. We mark them as breaking changes, so if you are using this part of the codebase, we recommend you take a look at the PRs to understand what changes were done exactly.
TFWrappedEmbeddings (breaking: TF embedding initialization updated for encoder-decoder models) by @gante in #19263pipeline by @ArthurZucker in #19482nested_XXX functions to mappings/dicts. by @Guillem96 in #19455TFGroupViT CI by @ydshieh in #19461DeiT and TFGroupViT by @ydshieh in #19466WhisperModelIntegrationTests.test_large_batched_generation by @ydshieh in #19472XLMRoberta model and config independent from Roberta by @asofiaoliveira in #19359get_embedding dtype at init. time by @ydshieh in #19473XLMProphet model from Prophet by @srhrshr in #19406generate & device_map=auto & half precision models by @younesbelkada in #19468python3 instead of python in push CI setup job by @ydshieh in #19492OPTForQuestionAnswering doctest by @ydshieh in #19479configuration_bert.py to doctest by @ydshieh in #19485MobileBert tokenizers independent from Bert by @501Good in #19531MarkupLMForMaskedLM from MODEL_WITH_LM_HEAD_MAPPING_NAMES by @ydshieh in #19534configuration_yolos.py by @daspartho in #19539Add configuration_whisper.py by @daspartho in #19540getattribute_from_module can't find anything by @ydshieh in #19535MarkupLMConfig by @ydshieh in #19547configuration_vit.py by @daspartho in #19561ViTMAE and YOSO by @grgkaran03 in #19567DebertaV2ForMultipleChoice Pytorch by @IMvision12 in #19536configuration_blenderbot.py by @grgkaran03 in #19577configuration_blenderbot_small.py by @grgkaran03 in #19589configuration_bigbird_pegasus.py and configuration_big_bird.py by @Xabilahu in #19606test_tf_encode_plus_sent_to_model for TAPAS by @ydshieh in #19559ImageToTextPipelineTests.test_small_model_tf by @ydshieh in #19565FlaubertTokenizer by @ydshieh in #19552configuration_resnet.py by @daspartho in #19620. in layer name by @ArthurZucker in #19124configuration_data2vec_text.py by @daspartho in #19636configuration_trocr.py by @thliang01 in #19658DocumentQuestionAnsweringPipeline by @ankrgyl in #19584facebook/ by @Rocketknight1 in #19675configuration_data2vec_vision.py by @daspartho in #19637VisualBertConfig doc example by @ydshieh in #19692image-segmentation pipeline tests. by @Narsil in #19710configuration_pegasus_x.py by @mukesh663 in #19725accelerate support for Whisper by @younesbelkada in #19697FlavaConfig and FNetConfig by @ndrohith09 in #19724configuration_clip.py by @daspartho in #19647configuration_wavlm.py by @juancopi81 in #19749configuration_decision_transformer.py by @Xabilahu in #19751configuration_detr.py by @Xabilahu in #19752image-segmentation pipeline: re-enable small_model_pt test. by @Narsil in #19716ImageToTextPipelineTests.test_small_model_tf by @ydshieh in #19785test_torchscrip_xxx CI by updating _create_and_check_torchscript by @ydshieh in #19786MaskFormerConfig doctest by @sha016 in #19817configuration_plbart.py by @ayaka14732 in #19809configuration_poolformer.py by @ayaka14732 in #19808configuration_electra.py by @ayaka14732 in #19807configuration_nezha.py by @ayaka14732 in #19810LEDModelIntegrationTests expected values by @ydshieh in #19841MarkupLM by @ydshieh in #19845GenerationMixin.contrastive_search by @ydshieh in #19863image-segmentation pipeline. by @Narsil in #19727MCTCT, MBart and LayoutLM by @Revanth2002 in #19889max_diff in test_save_load_fast_init_to_base by @ydshieh in #19849accelerate support for RoBERTa family by @younesbelkada in #19906accelerate support for M2M100 by @younesbelkada in #19912accelerate support for BART-like models by @younesbelkada in #19927The following contributors have made significant changes to the library over the last release:
XLMRoberta model and config independent from Roberta (#19359)XLMProphet model from Prophet (#19406)DebertaV2ForMultipleChoice Pytorch (#19536)MobileBert tokenizers independent from Bert (#19531)configuration_pegasus_x.py (#19725)Fix a revert introduced by mistake making the "automatic-speech-recognition" for Whisper.
Fix a revert introduced by mistake making the "automatic-speech-recognition" for Whisper.
Update Protobuf dependency version to fix known vulnerability by @qthequartermasterman in #19247
The Whisper model was proposed in Robust Speech Recognition via Large-Scale Weak Supervision by Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine McLeavey, Ilya Sutskever.
Whisper is an encoder-decoder Transformer trained on 680,000 hours of labeled (transcribed) audio. The model shows impressive performance and robustness in a zero-shot setting, in multiple languages.
The Deformable DETR model was proposed in Deformable DETR: Deformable Transformers for End-to-End Object Detection by Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, Jifeng Dai.
Deformable DETR mitigates the slow convergence issues and limited feature spatial resolution of the original DETR by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference.
The Conditional DETR model was proposed in Conditional DETR for Fast Training Convergence by Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, Jingdong Wang.
Conditional DETR presents a conditional cross-attention mechanism for fast DETR training. Conditional DETR converges 6.7× to 10× faster than DETR.
The Time Series Transformer model is a vanilla encoder-decoder Transformer for time series forecasting.
The model is trained in a similar way to how one would train an encoder-decoder Transformer (like T5 or BART) for machine translation; i.e. teacher forcing is used. At inference time, one can autoregressively generate samples, one time step at a time.
:warning: This is a recently introduced model and modality, so the API hasn't been tested extensively. There may be some bugs or slight breaking changes to fix it in the future. If you see something strange, file a Github Issue.
The ViTMSN model was proposed in Masked Siamese Networks for Label-Efficient Learning by Mahmoud Assran, Mathilde Caron, Ishan Misra, Piotr Bojanowski, Florian Bordes, Pascal Vincent, Armand Joulin, Michael Rabbat, Nicolas Ballas.
MSN (masked siamese networks) consists of a joint-embedding architecture to match the prototypes of masked patches with that of the unmasked patches. With this setup, the method yields excellent performance in the low-shot and extreme low-shot regimes for image classification, outperforming other self-supervised methods such as DINO. For instance, with 1% of ImageNet-1K labels, the method achieves 75.7% top-1 accuracy.
The MarkupLM model was proposed in MarkupLM: Pre-training of Text and Markup Language for Visually-rich Document Understanding by Junlong Li, Yiheng Xu, Lei Cui, Furu Wei.
MarkupLM is BERT, but applied to HTML pages instead of raw text documents. The model incorporates additional embedding layers to improve performance, similar to LayoutLM.
The model can be used for tasks like question answering on web pages or information extraction from web pages. It obtains state-of-the-art results on 2 important benchmarks: WebSRC and SWDE.
We explore a new serialization format not using Pickle that we can then leverage in the three frameworks we support: PyTorch, TensorFlow, and JAX. We leverage the safetensors library for that.
Support is for PyTorch models only at this stage, and still experimental.
The processors for computer vision have been overhauled to ensure they have consistent naming, input arguments and outputs.
:warning: The existing methods that are superseded by the introduced methods post_process_object_detection, post_process_semantic_segmentation, post_process_instance_segmentation, post_process_panoptic_segmentation are now deprecated.
The following changes are bugfixes that we have chosen to fix even if it changes the resulting behavior. We mark them as breaking changes, so if you are using this part of the codebase, we recommend you take a look at the PRs to understand what changes were done exactly..
Breaking change for ViT parameter initialization
Breaking change for the top_p argument of the TopPLogitsWarper of the generate method.
OPT and BLOOM now have question answering heads available.
OPTForQuestionAnswering by @clementapa in #19402BloomForQuestionAnswering by @younesbelkada in #19310There is now a zero-shot object detection pipeline.
The GroupViT model is now available in TensorFlow.
test_save_load for TFViTMAEModelTest by @ydshieh in #19040torchdynamo tests by @ydshieh in #19056use_cache by @younesbelkada in #19060LeViT checkpoint by @ydshieh in #19069test_export_to_onnx for LongT5 if torch < 1.11 by @ydshieh in #19122max_eval_samples by @lvwerra in #18722tokenizers release ! by @Narsil in #19139accelerate support for ViLT by @younesbelkada in #18683assertAlmostEqual in BloomEmbeddingTest.test_logits by @ydshieh in #19200cur_len in generation_utils.py by @ekagra-ranjan in #18874math.pi instead of torch.pi in MaskFormer by @ydshieh in #19201TFDeiTForImageClassification by @ydshieh in #19173m2m_100.mdx doc example missing labels by @Mustapha-AJEGHRIR in #19149hf_raise_for_status instead of deprecated _raise_for_status by @Wauplin in #19244HFValidationError in TrainingSummary by @ydshieh in #19252ViTMSNForImageClassification by @sayakpaul in #19183beautifulsoup4 to the dependency list by @ydshieh in #19253BloomConfig docstring by @younesbelkada in #19336ConvBert Tokenizer independent from bert Tokenizer by @IMvision12 in #19347Bert interdependency in tokenization_electra.py by @OtherHorizon in #19356Camembert TF version independent from Roberta by @Mustapha-AJEGHRIR in #19364ViTMSNForImageClassification doctest by @ydshieh in #19275BloomEmbeddingTest.test_embeddings for PyTorch < 1.10 by @ydshieh in #19261add_new_model.mdx by @Steboss89 in #18713The following contributors have made significant changes to the library over the last release:
ViTMSNForImageClassification (#19183)ConvBert Tokenizer independent from bert Tokenizer (#19347)m2m_100.mdx doc example missing labels (#19149)Camembert TF version independent from Roberta (#19364)add_new_model.mdx (#18713)Fixes a bug where a cached tokenizer/model was not accessible anymore offline (either forcing offline mode or because of an internet issue).
Fixes a bug where a cached tokenizer/model was not accessible anymore offline (either forcing offline mode or because of an internet issue).
Patch release for the following PRs:
Fix breaking change in onnxruntime for ONNX quantization by @severinsimmler in #18336
The Swin Transformer V2 model was proposed in Swin Transformer V2: Scaling Up Capacity and Resolution by Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, Baining Guo.
Swin Transformer v2 improves the original Swin Transformer using 3 main techniques: 1) a residual-post-norm method combined with cosine attention to improve training stability; 2) a log-spaced continuous position bias method to effectively transfer models pre-trained using low-resolution images to downstream tasks with high-resolution inputs; 3) A self-supervised pre-training method, SimMIM, to reduce the needs of vast labeled images.
The VideoMAE model was proposed in VideoMAE: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training by Zhan Tong, Yibing Song, Jue Wang, Limin Wang. VideoMAE extends masked auto encoders (MAE) to video, claiming state-of-the-art performance on several video classification benchmarks.
VideoMAE is an extension of ViTMAE for video.
The Donut model was proposed in OCR-free Document Understanding Transformer by Geewook Kim, Teakgyu Hong, Moonbin Yim, Jeongyeon Nam, Jinyoung Park, Jinyeong Yim, Wonseok Hwang, Sangdoo Yun, Dongyoon Han, Seunghyun Park. Donut consists of an image Transformer encoder and an autoregressive text Transformer decoder to perform document understanding tasks such as document image classification, form understanding and visual question answering.
The PEGASUS-X model was proposed in Investigating Efficiently Extending Transformers for Long Input Summarization by Jason Phang, Yao Zhao and Peter J. Liu.
PEGASUS-X (PEGASUS eXtended) extends the PEGASUS models for long input summarization through additional long input pretraining and using staggered block-local attention with global tokens in the encoder.
The X-CLIP model was proposed in Expanding Language-Image Pretrained Models for General Video Recognition by Bolin Ni, Houwen Peng, Minghao Chen, Songyang Zhang, Gaofeng Meng, Jianlong Fu, Shiming Xiang, Haibin Ling. X-CLIP is a minimal extension of CLIP for video. The model consists of a text encoder, a cross-frame vision encoder, a multi-frame integration Transformer, and a video-specific prompt generator.
X-CLIP is a minimal extension of CLIP for video-language understanding.
ERNIE is a series of powerful models proposed by baidu, especially in Chinese tasks, including ERNIE1.0, ERNIE2.0, ERNIE3.0, ERNIE-Gram, ERNIE-health, etc. These models are contributed by nghuyong and the official code can be found in PaddleNLP (in PaddlePaddle).
MobileViT and LayoutLMv3 are now available in TensorFlow.
A new question answering head was added for the LayoutLM model.
Two new pipelines are available in transformers: a document question answering pipeline, as well as an image to text generation pipeline.
There is now Mac M1 support in PyTorch in transformers in pipelines and the Trainer.
pipeline support for device="mps" (or any other string) by @julien-c in #18494mps integration by @pacman100 in #18598Starting from version v4.22.0, we'll now officially support PyTorch and TensorFlow versions that were released up to two years ago. Versions older than two years-old will not be supported going forward.
We're making this change as we begin actively testing transformers compatibility on older versions. This project can be followed here.
The generate method now starts enforcing stronger validation in order to ensure proper usage.
model_kwargs (and catch typos in generate arguments) by @gante in #18261model_kwargs on TF (and catch typos in generate arguments) by @gante in #18651The as_target_tokenizer and as_target_processor context managers have been deprecated. The new API is to use the call method of the tokenizer/processor with keyword arguments. For instance:
with tokenizer.as_target_tokenizer():
encoded_labels = tokenizer(labels, padding=True)
becomes
encoded_labels = tokenizer(text_target=labels, padding=True)
as_target context managers by direct calls by @sgugger in #18325Bits and bytes is now integrated within transformers. This feature can reduce the size of large models by up to 2, with low loss in precision.
bitsandbytes integration by @younesbelkada in #18579bitsandbytes - Linear8bitLt integration into transformers models by @younesbelkada in #17901Models that have sharded checkpoints in PyTorch can be loaded in Flax.
The TensorFlow examples have been rewritten to support all recent features developped in the past months.
DeBERTa-v2 is now trainable with XLA.
position_ids by @thomasw21 in #18342test_load_default_pipelines_tf test error by @ydshieh in #18422generate docstring by @JoaoLages in #18198trust_remote_code and ignore it in PreTrainedModel.from_pretrained by @ydshieh in #18428TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING by @ydshieh in #18469TFSwinLayer to increase serving compatibility by @harrydrippin in #18352test_dbmdz_english by updating expected values by @ydshieh in #18482quicktour.mdx for resampy 0.3.0 by @ydshieh in #18484transformers-cli login => huggingface-cli login by @julien-c in #18490run_call_with_unpacked_inputs by @ydshieh in #18541align_to_words param to qa pipeline. by @Narsil in #18010load_state_dict by @pacman100 in #18596TFAutoModelForSemanticSegmentation to the main __init__.py by @ydshieh in #18600detectron2 for CircleCI tests by @ydshieh in #18680onnxruntime for ONNX quantization by @severinsimmler in #18336model.tie_weights() should be applied after accelerator.prepare() by @Gladiator07 in #18676**model_kwargs in sample tests by @gante in #18696microsoft/tapex-base-finetuned-wtq by @Narsil in #18711add_tokens docstring by @SaulLu in #18687XGLMModel by @stancld in #16543__call__ method is faster than encode + pad for a fast tokenizer by @SaulLu in #18693torch_fx tests by @ydshieh in #18547test_cached_files_are_used_when_internet_is_down by @Wauplin in #18804HfArgumentParser.parse_{dict,json_file} to raise an Exception when there extra keys by @FelixSchneiderZoom in #18692state_dict to release memory as early as possible by @ydshieh in #18832Seq2SeqTrainer by @kumapo in #18786test_tf_encode_plus_sent_to_model for LayoutLMv3 by @ydshieh in #18898Perplexity of fixed-length models by @ekagra-ranjan in #18906_create_and_check_torch_fx_tracing in specific test files by @ydshieh in #18667decoder_position_ids from check_decoder_model_past_large_inputs by @ydshieh in #18980require_tf for TFOPTGenerationTest by @ydshieh in #19010The following contributors have made significant changes to the library over the last release:
XGLMModel (#16543)Patch release to add a disclaimer about torch models hosted on the Hub. See autoclass tutorial.
Patch release to add a disclaimer about torch models hosted on the Hub. See autoclass tutorial.
Fix a regression in the TableQA pipeline: Fix a regression in Trainer checkpoint loading: #18428
Fix a regression in the TableQA pipeline: Fix a regression in Trainer checkpoint loading: #18428
Fix a regression in Trainer checkpoint loading: #18470
Fix a regression in Trainer checkpoint loading: #18470
Generate: deprecate default max_length by @gante in #18018
The TensorFlow text generation method can now be wrapped with tf.function and compiled to XLA. You should be able to achieve up to 100x speedup this way. See our blog post and our benchmarks. You can also see XLA generation in action in our example notebooks, particularly for summarization and translation.
import tensorflow as tf
from transformers import AutoTokenizer, TFAutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("t5-small")
model = TFAutoModelForSeq2SeqLM.from_pretrained("t5-small")
# Main changes with respect to the original generate workflow: `tf.function` and `pad_to_multiple_of`
xla_generate = tf.function(model.generate, jit_compile=True)
tokenization_kwargs = {"pad_to_multiple_of": 32, "padding": True, "return_tensors": "tf"}
# The first prompt will be slow (compiling), the others will be very fast!
input_prompts = [
f"translate English to {language}: I have four cats and three dogs."
for language in ["German", "French", "Romanian"]
]
for input_prompt in input_prompts:
tokenized_inputs = tokenizer([input_prompt], **tokenization_kwargs)
generated_text = xla_generate(**tokenized_inputs, max_new_tokens=32)
print(tokenizer.decode(generated_text[0], skip_special_tokens=True))
max_length by @gante in #18018tf.TensorArray by @gante in #17801The OWL-ViT model (short for Vision Transformer for Open-World Localization) was proposed in Simple Open-Vocabulary Object Detection with Vision Transformers by Matthias Minderer, Alexey Gritsenko, Austin Stone, Maxim Neumann, Dirk Weissenborn, Alexey Dosovitskiy, Aravindh Mahendran, Anurag Arnab, Mostafa Dehghani, Zhuoran Shen, Xiao Wang, Xiaohua Zhai, Thomas Kipf, and Neil Houlsby. OWL-ViT is an open-vocabulary object detection network trained on a variety of (image, text) pairs. It can be used to query an image with one or multiple text queries to search for and detect target objects described in text.
The NLLB model was presented in No Language Left Behind: Scaling Human-Centered Machine Translation by Marta R. Costa-jussà, James Cross, Onur Çelebi, Maha Elbayad, Kenneth Heafield, Kevin Heffernan, Elahe Kalbassi, Janice Lam, Daniel Licht, Jean Maillard, Anna Sun, Skyler Wang, Guillaume Wenzek, Al Youngblood, Bapi Akula, Loic Barrault, Gabriel Mejia Gonzalez, Prangthip Hansanti, John Hoffman, Semarley Jarrett, Kaushik Ram Sadagopan, Dirk Rowe, Shannon Spruit, Chau Tran, Pierre Andrews, Necip Fazil Ayan, Shruti Bhosale, Sergey Edunov, Angela Fan, Cynthia Gao, Vedanuj Goswami, Francisco Guzmán, Philipp Koehn, Alexandre Mourachko, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, and Jeff Wang. No Language Left Behind (NLLB) is a model capable of delivering high-quality translations directly between any pair of 200+ languages — including low-resource languages like Asturian, Luganda, Urdu and more.
The MobileViT model was proposed in MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer by Sachin Mehta and Mohammad Rastegari. MobileViT introduces a new layer that replaces local processing in convolutions with global processing using transformers.
The Nezha model was proposed in NEZHA: Neural Contextualized Representation for Chinese Language Understanding by Junqiu Wei et al. NEZHA is a language model based on BERT with a collection of proven improvements, which include Functional Relative Positional Encoding as an effective positional encoding scheme, Whole Word Masking strategy, Mixed Precision Training and the LAMB Optimizer in training the models.
The GroupViT model was proposed in GroupViT: Semantic Segmentation Emerges from Text Supervision by Jiarui Xu, Shalini De Mello, Sifei Liu, Wonmin Byeon, Thomas Breuel, Jan Kautz, Xiaolong Wang. Inspired by CLIP, GroupViT is a vision-language model that can perform zero-shot semantic segmentation on any given vocabulary categories, inspired by CLIP.
The MVP model was proposed in MVP: Multi-task Supervised Pre-training for Natural Language Generation by Tianyi Tang, Junyi Li, Wayne Xin Zhao and Ji-Rong Wen. MVP is a generative language model, pre-trained on a labeled pre-training corpus from 45 datasets over seven generation tasks. For each task, the model is further pre-trained using specific soft prompts to stimulate the model capacity in performing a specific task.
The CodeGen model was proposed in A Conversational Paradigm for Program Synthesis by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. CodeGen is an autoregressive language model for program synthesis trained sequentially on The Pile, BigQuery, and BigPython.
The UL2 model was presented in Unifying Language Learning Paradigms by Yi Tay, Mostafa Dehghani, Vinh Q. Tran, Xavier Garcia, Dara Bahri, Tal Schuster, Huaixiu Steven Zheng, Neil Houlsby, Donald Metzler. UL2 is a unified framework for pretraining models that are universally effective across datasets and setups. UL2 uses Mixture-of-Denoisers (MoD), a pre-training objective that combines diverse pre-training paradigms together. UL2 introduces a notion of mode switching, wherein downstream fine-tuning is associated with specific pre-training schemes.
This adds the ability to support custom pipelines on the Hub and share it with everyone else. Like the code in the Hub feature for models, tokenizers etc., the user has to add trust_remote_code=True when they want to use it. Apart from this, the best way to get familiar with the feature is to look at the added documentation.
This adds a CLI to convert PT weights into TF weights, validate them, and (optionally) open a PR.
The following models have been ported to be used in TensorFlow: SegFormer, DeiT, ResNet and RegNet.
Additionally, our TF models now support loading sharded checkpoints:
The following models have been ported to be used in JAX:
Additionally, our JAX models now support loading sharded checkpoints:
The following models now have a brand new head for new tasks:
A continued community effort provides ONNX converters for an increasing number of models.
A community effort aiming to translate the documentation in several languages has been continued.
KerasMetricCallback to use XLA generation by @Rocketknight1 in #18265--make-reports by @ydshieh in #18250saved_model=True by @amyeroberts in #18153take_along_axis is computed in DeBERTa to stop confusing XLA by @Rocketknight1 in #18256(...)EncoderDecoder models by @gante in #18097no_trainer CI by @muellerzr in #18242LayoutXLM docstrings by @qqaatw in #17038device_map directly in pipeline(..) function. by @Narsil in #17902text-generation pipeline. by @Narsil in #18131pt_to_tf test by @gante in #18108TFGenerationMixin.seed_generator so it's not created at import by @Rocketknight1 in #18044bias keyword argument in TFDebertaEmbeddings by @WissamAntoun in #17940hf-internal-testing) by @mishig25 in #17939return_all_scores introduced in #17606 by @Narsil in #17906group_texts function, drop last block if smaller than block_size by @billray0259 in #17908test_number_of_steps_in_training_with_ipex by @ydshieh in #17889test_inference_instance_segmentation_head by @ydshieh in #17872test_multi_gpu_data_parallel_forward for MaskFormer by @ydshieh in #17864create_commit by @gante in #17755generate, to Seq2SeqTrainer methods evaluate and predict by @eranhirs in #17805top_k_top_p_filtering having unexpected behavior by @unifyh in #17744The following contributors have made significant changes to the library over the last release:
This patch releases fixes a bug in the OPT models and makes Transformers compatible with huggingface_hub version 0.8.1.
This patch releases fixes a bug in the OPT models and makes Transformers compatible with huggingface_hub version 0.8.1.
Fix tests of mixed precision now that experimental is deprecated by @Rocketknight1 in #17300
You can now use the big model inference of Accelerate directly in any call to from_pretrained by specifying device_map="auto" (or your own device_map). It will automatically load the model taking advantage of your GPU(s) then offloading what doesn't fit in RAM, or even on the hard drive if you don't have RAM. Your model can then be used normally for inference without anything else to do.
from transformers import AutoModelForSeq2SeqLM
model = AutoModelForSeq2SeqLM.from_pretrained(
"bigscience/T0pp", revision="sharded", device_map="auto"
)
from_pretrained for big model inference by @sgugger in #17341The BLOOM model has been proposed with its various versions through the BigScience Workshop. The architecture of BLOOM is essentially similar to GPT3 (auto-regressive model for next token prediction), but has been trained on different 46 languages including code.
The Convolutional vision Transformer (CvT) improves the Vision Transformer (ViT) in performance and efficiency by introducing convolutions into ViT to yield the best of both designs.
GPT-NeoX-20B is a 20 billion parameter autoregressive language model trained on the Pile, whose weights are made freely and openly available to the public through a permissive license. GPT-NeoX-20B is a particularly powerful few-shot reasoner and gains far more in performance when evaluated five-shot than similarly sized GPT-3 and FairSeq models.
LayoutLMv3 simplifies LayoutLMv2 by using patch embeddings (as in ViT) instead of leveraging a CNN backbone, and pre-trains the model on 3 objectives: masked language modeling (MLM), masked image modeling (MIM) and word-patch alignment (WPA).
LeViT improves the Vision Transformer (ViT) in performance and efficiency by a few architectural differences such as activation maps with decreasing resolutions in Transformers and the introduction of an attention bias to integrate positional information.
LongT5 model is an extension of T5 model, and it enables using one of the two different efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention. It is capable of handling input sequences of a length up to 16,384 tokens.
LongT5 model by @stancld in #16792The M-CTC-T model is a 1B-param transformer encoder, with a CTC head over 8065 character labels and a language identification head over 60 language ID labels. It is trained on Common Voice (version 6.1, December 2020 release) and VoxPopuli. After training on Common Voice and VoxPopuli, the model is trained on Common Voice only. The labels are unnormalized character-level transcripts (punctuation and capitalization are not removed). The model takes as input Mel filterbank features from a 16Khz audio signal.
This Transformer is used for deep reinforcement learning. To use it, you need to create sequences from actions, states and rewards from all previous timesteps. This model will treat all these elements together as one big sequence (a trajectory).
The Wav2Vec2-Conformer is an updated version of fairseq S2T: Fast Speech-to-Text. It requires more parameters than Wav2Vec2, but also yields an improved word error rate.
Data2VecVision for semantic segmentation, OPT and Swin are now available in TensorFlow.
OPT is now available in Flax.
A community effort has been started to translate the documentation in two new languages: Italian and Portuguese.
BloomForSequenceClassification and BloomForTokenClassification classes by @haileyschoelkopf in #17639RepoNotFoundError when not authenticated by @SBrandeis in #17651float16. by @Narsil in #17637top_k argument to text-classification pipeline. by @Narsil in #17606train_new_from_iterator in the case of byte-level tokenizers by @SaulLu in #17549pt-to-tf by @gante in #17588tokenizer type annotation in pipeline(...) by @willfrey in #17500PreTrainedTokenizerBase.add_tokens() by @Witiko in #17119test_inference_no_head by @ydshieh in #17395imageGPT auto feature extractor. by @Narsil in #16871device_map="auto" to OPT by @sgugger in #17382batch_size test to QA pipeline. by @Narsil in #17330max_seq_len in QA pipeline by @Narsil in #17316test_torch_encode_plus_sent_to_model by @SaulLu in #17231The following contributors have made significant changes to the library over the last release:
LongT5 model (#16792)Fixes the errors message when trying to access a repo that does not exist (started to break due to changes in Hub API).
Fixes the errors message when trying to access a repo that does not exist (started to break due to changes in Hub API).
[🐛]Properly raise RepoNotFoundError when not authenticated #17651[
This patch release fixes the install of protobuf when a user wants to do pip install transformers[sentencepiece].
This patch release fixes the install of protobuf when a user wants to do pip install transformers[sentencepiece].
Patch release for the following PRs/commits:
Patch release for the following PRs/commits:
Fix Trainer for Datasets that don't have dict items #17239
Fix Trainer for Datasets that don't have dict items #17239
bert: properly mention deprecation of TF2 conversion script by @stefan-it in #16171
Disclaimer: this release is the first release with no Python 3.6 support.
The OPT model was proposed in Open Pre-trained Transformer Language Models by Meta AI. OPT is a series of open-sourced large causal language models which perform similar in performance to GPT3.
The FLAVA model was proposed in FLAVA: A Foundational Language And Vision Alignment Model by Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela and is accepted at CVPR 2022.
The paper aims at creating a single unified foundation model which can work across vision, language as well as vision-and-language multimodal tasks.
The YOLOS model was proposed in You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection by Yuxin Fang, Bencheng Liao, Xinggang Wang, Jiemin Fang, Jiyang Qi, Rui Wu, Jianwei Niu, Wenyu Liu. YOLOS proposes to just leverage the plain Vision Transformer (ViT) for object detection, inspired by DETR. It turns out that a base-sized encoder-only Transformer can also achieve 42 AP on COCO, similar to DETR and much more complex frameworks such as Faster R-CNN.
The RegNet model was proposed in Designing Network Design Spaces by Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, Piotr Dollár.
The authors design search spaces to perform Neural Architecture Search (NAS). They first start from a high dimensional search space and iteratively reduce the search space by empirically applying constraints based on the best-performing models sampled by the current search space.
The TAPEX model was proposed in TAPEX: Table Pre-training via Learning a Neural SQL Executor by Qian Liu, Bei Chen, Jiaqi Guo, Morteza Ziyadi, Zeqi Lin, Weizhu Chen, Jian-Guang Lou. TAPEX pre-trains a BART model to solve synthetic SQL queries, after which it can be fine-tuned to answer natural language questions related to tabular data, as well as performing table fact checking.
The Data2Vec model was proposed in data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and Michael Auli. Data2Vec proposes a unified framework for self-supervised learning across different data modalities - text, audio and images. Importantly, predicted targets for pre-training are contextualized latent representations of the inputs, rather than modality-specific, context-independent targets.
The vision model is added in v4.19.0.
PyTorch recently upstreamed the Fairscale FSDP into PyTorch Distributed with additional optimizations. This PR is aimed at integrating it into Trainer API.
It enables Distributed Training at Scale. It's a wrapper for sharding Module parameters across data parallel workers. This is inspired by Xu et al. as well as the ZeRO Stage 3 from DeepSpeed. PyTorch FSDP will focus more on production readiness and long-term support. This includes better integration with ecosystems and improvements on performance, usability, reliability, debuggability and composability.
New example scripts were added for image classification and semantic segmentation. Both now have versions that leverage the Trainer API and Accelerate.
To continue democratizing good machine learning, we're making the Transformers documentation more accessible to non-English speakers; starting with Spanish (572M speakers worldwide).
DataCollatorWithPadding by @secsilm in #16662SpmConverter for sentencepiece's model using the byte fallback feature by @SaulLu in #16629no_trainer scripts by @muellerzr in #16703Tapex in table question answering pipeline. by @Narsil in #16663.from_pretrained] Raise a warning if model weights are not in float32 by @sanchit-gandhi in #16762from_pretrained(..., low_cpu_mem_usage=True) + tests by @stas00 in #16657LayoutLMv2 tokenization docstrings by @qqaatw in #16187rum_clm.py seeking text column name twice by @dandelin in #16624attention_mask on gpt2 by @wiio12 in #16829Speech2TextTokenizer by Speech2TextFeatureExtractor in some docstrings by @SaulLu in #16835num_return_sequences>1. by @Narsil in #16828array key in raw dictionnaries in ASR pipeline. by @Narsil in #16827convert_file_size_to_int by @mariosasko in #16891distributed_concat with scalar tensor by @Yard1 in #16963decoder_module by @sanchit-gandhi in #17036token_type_ids by @deutschmn in #17082mobilebert onnx configs by @manandey in #17029question_answering pipeline. by @Narsil in #17143Trainer by @Yard1 in #17166The following contributors have made significant changes to the library over the last release:
Replace all deprecated jax.ops operations with jnp's at by @sanchit-gandhi in https://github.com/huggingface/transformers/pull/16078
You'll notice that we are starting to add several older models in vision. This is because those models are used as backbones in recent architectures. While we could rely on existing libraries for such pretrained models, we will ultimately need some support for those backbones in PyTorch/TensorFlow and Jax, and there is currently no library that supports those three frameworks. This is why we are starting to add those models to Transformers directly (here ResNet and VAN)
The GLPN model was proposed in Global-Local Path Networks for Monocular Depth Estimation with Vertical CutDepth by Doyeon Kim, Woonghyun Ga, Pyungwhan Ahn, Donggyu Joo, Sehwan Chun, Junmo Kim. GLPN combines SegFormer’s hierarchical mix-Transformer with a lightweight decoder for monocular depth estimation. The proposed decoder shows better performance than the previously proposed decoders, with considerably less computational complexity.
The ResNet model was proposed in Deep Residual Learning for Image Recognition by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by Nvidia, we apply the stride=2 for downsampling in bottleneck’s 3x3 conv and not in the first 1x1. This is generally known as “ResNet v1.5”.
ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision.
The VAN model was proposed in Visual Attention Network by Meng-Hao Guo, Cheng-Ze Lu, Zheng-Ning Liu, Ming-Ming Cheng, Shi-Min Hu.
This paper introduces a new attention layer based on convolution operations able to capture both local and distant relationships. This is done by combining normal and large kernel convolution layers. The latter uses a dilated convolution to capture distant correlations.
The VisionTextDualEncoderModel can be used to initialize a vision-text dual encoder model with any pretrained vision autoencoding model as the vision encoder (e.g. ViT, BEiT, DeiT) and any pretrained text autoencoding model as the text encoder (e.g. RoBERTa, BERT). Two projection layers are added on top of both the vision and text encoder to project the output embeddings to a shared latent space. The projection layers are randomly initialized so the model should be fine-tuned on a downstream task. This model can be used to align the vision-text embeddings using CLIP like contrastive image-text training and then can be used for zero-shot vision tasks such image-classification or retrieval.
In LiT: Zero-Shot Transfer with Locked-image Text Tuning it is shown how leveraging pre-trained (locked/frozen) image and text model for contrastive learning yields significant improvment on new zero-shot vision tasks such as image classification or retrieval.
DiT was proposed in DiT: Self-supervised Pre-training for Document Image Transformer by Junlong Li, Yiheng Xu, Tengchao Lv, Lei Cui, Cha Zhang, Furu Wei. DiT applies the self-supervised objective of BEiT (BERT pre-training of Image Transformers) to 42 million document images, allowing for state-of-the-art results on tasks including:
The DPT model was proposed in Vision Transformers for Dense Prediction by René Ranftl, Alexey Bochkovskiy, Vladlen Koltun. DPT is a model that leverages the Vision Transformer (ViT) as backbone for dense prediction tasks like semantic segmentation and depth estimation.
Large models are becoming more and more the norm and having a checkpoint in a single file is challenging for several reasons:
That's why the save_pretrained method will know automatically shard a checkpoint in several files when you go above a 10GB threshold for PyTorch models. from_pretrained will handle such sharded checkpoints as if there was only one file.
GPT-J and ViTMAE are now available in TensorFlow.
The IA migration is wrapped up with a new conceptual guide available.
torch.diag by @Narsil in https://github.com/huggingface/transformers/pull/15890MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING by @Narsil in https://github.com/huggingface/transformers/pull/15934max_length in BeamScorer.finalize()) by @cwkeam in https://github.com/huggingface/transformers/pull/15555ForInstanceSegmentation models to image-segmentation pipelines by @Narsil in https://github.com/huggingface/transformers/pull/15937pos optional in PerceiverAudioPreprocessor to avoid crashing PerceiverModel operation by @basilevh in https://github.com/huggingface/transformers/pull/15972'torch.dtype' has str-type value in config and all nested dicts for JSON serializability by @feifang24 in https://github.com/huggingface/transformers/pull/16065HF_ENDPOINT for custom endpoints by @sgugger in https://github.com/huggingface/transformers/pull/16139hidden_states by @ydshieh in https://github.com/huggingface/transformers/pull/16167jax.ops operations with jnp's at by @sanchit-gandhi in https://github.com/huggingface/transformers/pull/16078has_attentions as done in PyTorch side by @ydshieh in https://github.com/huggingface/transformers/pull/16259add-new-model-like work in an env without all frameworks by @sgugger in https://github.com/huggingface/transformers/pull/16239cached_download ∘ hf_hub_url is hf_hub_download by @julien-c in https://github.com/huggingface/transformers/pull/16375torch.distributed process group if one is already initailized by @Yard1 in https://github.com/huggingface/transformers/pull/16487segmentation_maps by @FrancescoSaverioZuppichini in https://github.com/huggingface/transformers/pull/15964run_qa_no_trainer.py by @bhadreshpsavani in https://github.com/huggingface/transformers/pull/16508__init__.py: modeling_xglm -> modeling_flax_xglm by @stancld in https://github.com/huggingface/transformers/pull/16556convert_tokens_to_string's output by @SaulLu in https://github.com/huggingface/transformers/pull/16540unpack_inputs-related changes by @gante in https://github.com/huggingface/transformers/pull/16499_load_pretrained_model_low_mem static + bug fix by @FrancescoSaverioZuppichini in https://github.com/huggingface/transformers/pull/16548The community contributors below have significantly contributed to the v4.18.0 release. Thank you!
@sayakpaul, for contributing the TensorFlow version of ViTMAE @stancld, for contributing the TensorFlow version of of GPT-J
Full Changelog: https://github.com/huggingface/transformers/compare/v4.17.0...v4.18.0
Prepare deprecated ONNX exporter for torch v1.11 by @lewtun in https://github.com/huggingface/transformers/pull/15388
The XGLM model was proposed in Few-shot Learning with Multilingual Language Models by Xi Victoria Lin, Todor Mihaylov, Mikel Artetxe, Tianlu Wang, Shuohui Chen, Daniel Simig, Myle Ott, Naman Goyal, Shruti Bhosale, Jingfei Du, Ramakanth Pasunuru, Sam Shleifer, Punit Singh Koura, Vishrav Chaudhary, Brian O’Horo, Jeff Wang, Luke Zettlemoyer, Zornitsa Kozareva, Mona Diab, Veselin Stoyanov, Xian Li.
XGLM is a GPT3-like multilingual model trained on a balanced corpus covering a diverse set of languages.
The ConvNeXT model was proposed in A ConvNet for the 2020s by Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, Saining Xie.
ConvNeXT is a pure convolutional model (ConvNet), inspired by the design of Vision Transformers, that claims to outperform them.
The PoolFormer model was proposed in MetaFormer is Actually What You Need for Vision by Sea AI Labs.
The PLBART model was proposed in Unified Pre-training for Program Understanding and Generation by Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei Chang.
This is a BART-like model which can be used to perform code-summarization, code-generation, and code-translation tasks. The pre-trained model plbart-base has been trained using multilingual denoising task on Java, Python and English.
The Data2Vec model was proposed in data2vec: A General Framework for Self-supervised Learning in Speech, Vision and Language by Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu and Michael Auli.
Data2Vec proposes a unified framework for self-supervised learning across different data modalities - text, audio and images. Importantly, predicted targets for pre-training are contextualized latent representations of the inputs, rather than modality-specific, context-independent targets.
The MaskFormer model was proposed in Per-Pixel Classification is Not All You Need for Semantic Segmentation by Bowen Cheng, Alexander G. Schwing, Alexander Kirillov.
MaskFormer addresses semantic segmentation with a mask classification paradigm instead of performing classic pixel-level classification.
This is a new experimental feature added to the library. It allows you to share a custom model (with configuration, tokenizer, feature extractor, processor) with anyone through the Model Hub while still using the Auto-classes API of the Transformers library.
See the documentation for more information!
We are working on updating the existing guides in the documentation, and writing more!
Speech models that have been trained with the CTC loss (Wav2Vec2, XLS-R, HuBERT, WavLM, ...) can now output the time
stamp in addition to the transcription of the input audio. E.g. one can retrieve the start and end time for every transcribed word
via the Wav2Vec2CTCTokenizer.decode method or the Wav2Vec2ProcessorWithLM.decoder method. See the documentation here and here respectively.
This feature can also be directly used via the ASR pipeline - see here and this example.
Unfortunately, some bugs had crept into CLIPTokenizerFast : the tokenization produced by CLIPTokenizer and CLIPTokenizerFast were not equal. CLIPTokenizerFast has been corrected to encode the text with the same strategy as CLIPTokenizer.
What does this mean for you ? You need to use the tokenizer that was used to train the CLIP template you are using. For example:
openai/clip-vit-base-patch32, openai/clip-vit-base-patch16 or openai/clip-vit-large-patch14 , before v4.17.0 the good version of the tokenizer was CLIPTokenizer. From v4.17.0, you can use both CLIPTokenizer and CLIPTokenizerFast.CLIPTokenizerFast. Your tokenizer is no longer a CLIPTokenizerFast and we recommend you to load your tokenizer.json in a PreTrainedTokenizerFast directly or to continue to use a version prior to v4.17.0.CLIPTokenizer. Now, you can produce a fast equivalent of your tokenizer by doing CLIPTokenizerFast.from_pretrained("Path to local folder or Hub repo with slow tokenizer files", from_slow=True).To make CLIPTokenizerFast identical to CLIPTokenizer, the template of the tokenization of a sentence pair (A,B) has been modified. The previous template was <|startoftext|> A B <|endoftext|> and the new one is <|startoftext|> A <|endoftext|> <|endoftext|> B <|endoftext|>.
batch_size and num_return_Sequences in text-generation pipeline by @Narsil in https://github.com/huggingface/transformers/pull/15318bad_words_ids not working with sentencepiece-based tokenizers by @ngoquanghuy99 in https://github.com/huggingface/transformers/pull/15343pr_check by @ngoquanghuy99 in https://github.com/huggingface/transformers/pull/15380PreTrainedTokenizerBase __init__ by @SaulLu in https://github.com/huggingface/transformers/pull/15454tokenizer_config.json file for the slow tokenizer when a fast version is available by @SaulLu in https://github.com/huggingface/transformers/pull/15319Trainer.push_to_hub always tries to push to the Hub by @sgugger in https://github.com/huggingface/transformers/pull/15463microphone streaming within pipeline. by @Narsil in https://github.com/huggingface/transformers/pull/15046__init__ of PreTrainedTokenizerBase by @SaulLu in https://github.com/huggingface/transformers/pull/15456requires_backends by @tkukurin in https://github.com/huggingface/transformers/pull/15636tokenizers>=0.11.1 by @aphedges in https://github.com/huggingface/transformers/pull/15266KeyDataset. by @Narsil in https://github.com/huggingface/transformers/pull/15645decoder_kwargs to send to LM on asr pipeline. by @Narsil in https://github.com/huggingface/transformers/pull/15646HfDeepSpeedConfig argument in Trainer by @jaketae in https://github.com/huggingface/transformers/pull/15711HfArgumentParser when passing a generator by @bryant1410 in https://github.com/huggingface/transformers/pull/15758hf-internal-testing/tiny-clip for instance) by @Narsil in https://github.com/huggingface/transformers/pull/15782image-segmentation on AutoModelForSemanticSegmentation by @Narsil in https://github.com/huggingface/transformers/pull/15647The community contributors below have significantly contributed to the v4.17.0 release. Thank you!
@sayakpaul, for contributing the TensorFlow version of ConvNext @gchhablani, for contributing PLBart @edugp, for contributing Data2Vec
Full Changelog: https://github.com/huggingface/transformers/compare/v4.16.0...v4.17.0
[Hotfix] Fix Swin model outputs (huggingface#15414)
Full Changelog: https://github.com/huggingface/transformers/compare/v4.16.1...v4.16.2
Add init to BORT (#15378) by @LysandreJik
Add init to BORT (#15378) by @LysandreJik
Deprecates AdamW and adds --optim by @manuelciosici in https://github.com/huggingface/transformers/pull/14744
The Nyströmformer model was proposed in Nyströmformer: A Nyström-Based Algorithm for Approximating Self-Attention by Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn Fung, Yin Li, and Vikas Singh.
The Nyströmformer model overcomes the quadratic complexity of self-attention on the input sequence length by adapting the Nyström method to approximate standard self-attention, enabling longer sequences with thousands of tokens as input.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=nystromformer
The REALM model was proposed in REALM: Retrieval-Augmented Language Model Pre-Training by Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat and Ming-Wei Chang.
It’s a retrieval-augmented language model that firstly retrieves documents from a textual knowledge corpus and then utilizes retrieved documents to process question answering tasks.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=realm
The ViTMAE model was proposed in Masked Autoencoders Are Scalable Vision Learners by Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, Ross Girshick.
The paper shows that, by pre-training a Vision Transformer (ViT) to reconstruct pixel values for masked patches, one can get results after fine-tuning that outperform supervised pre-training.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=vit_mae
The ViLT model was proposed in ViLT: Vision-and-Language Transformer Without Convolution or Region Supervision by Wonjae Kim, Bokyung Son, Ildoo Kim.
ViLT incorporates text embeddings into a Vision Transformer (ViT), allowing it to have a minimal design for Vision-and-Language Pre-training (VLP).
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=vilt
The Swin Transformer was proposed in Swin Transformer: Hierarchical Vision Transformer using Shifted Windows by Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, Baining Guo.
The Swin Transformer serves as a general-purpose backbone for computer vision. The shifted windowing scheme brings greater efficiency by limiting self-attention computation to non-overlapping local windows while also allowing for cross-window connection. This hierarchical architecture has the flexibility to model at various scales and has linear computational complexity with respect to image size.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=swin
The YOSO model was proposed in You Only Sample (Almost) Once: Linear Cost Self-Attention Via Bernoulli Sampling by Zhanpeng Zeng, Yunyang Xiong, Sathya N. Ravi, Shailesh Acharya, Glenn Fung, Vikas Singh.
YOSO approximates standard softmax self-attention via a Bernoulli sampling scheme based on Locality Sensitive Hashing (LSH). In principle, all the Bernoulli random variables can be sampled with a single hash.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=yoso
To help contributors add new models more easily to Transformers, there is a new command that will clone an existing model and set the various hooks in the library, so that you only have to write the tweaks needed to the modeling file. Just run transformers-cli add-new-model-like and fill the questionnaire!
New training scripts were introduced, for speech seq2seq models and an image pre-training script leveraging the ViTMAE models. Finally, an image captioning example in Flax gets added to the library.
Adding support for long files on automatic-speech-recognition (ASR) as well as supporting audio models with LM which increases the WER on many tasks See the blogpost.
Also continuously increasing homogeneity in arguments, framework support on all pipelines.
TF on image-classification pipeline. by @Narsil in https://github.com/huggingface/transformers/pull/15030batch_size enabled on zero-cls and qa pipelines. by @Narsil in https://github.com/huggingface/transformers/pull/14225The ELECTRA model can now be used as a decoder, enabling an ELECTRA encoder-decoder model.
ElectraForCausalLM -> Enable Electra encoder-decoder model by @stancld in https://github.com/huggingface/transformers/pull/14729<FILL ME>
The vision encoder decoder model can now be used in TensorFlow.
CLIP gets ported to TensorFlow.
RoFormer gets ported to Flax.
--optim by @manuelciosici in https://github.com/huggingface/transformers/pull/14744The documentation has been fully migrated to MarkDown, if you are making contribution, make sure to read the upgraded guide on how to write good docstrings.
AttributeError from PreTrainedTokenizerFast.decoder by @aphedges in https://github.com/huggingface/transformers/pull/14691run_name in MLflowCallback by @YangDong2002 in https://github.com/huggingface/transformers/pull/14894num_return_sequences support for text2text generation. by @Narsil in https://github.com/huggingface/transformers/pull/14988tokenizers upgrade. by @Narsil in https://github.com/huggingface/transformers/pull/14941chunk_length_s instead of _ms. by @Narsil in https://github.com/huggingface/transformers/pull/15029batch_size arg (like others enabled everywhere). by @Narsil in https://github.com/huggingface/transformers/pull/15027with torch.no_grad() to DistilBERT integration test forward pass by @jaketae in https://github.com/huggingface/transformers/pull/14979tokenize_chinese_chars arg by @SaulLu in https://github.com/huggingface/transformers/pull/15158np.ndarray optional arguments by @gante in https://github.com/huggingface/transformers/pull/15074is_ctc needs to be updated to `self.type == "ctc". by @Narsil in https://github.com/huggingface/transformers/pull/15194from_encoder_decoder_pretrained in encoder-decoder models by @jsnfly in https://github.com/huggingface/transformers/pull/15056The community contributors below have significantly contributed to the v4.16.0 release. Thank you!
Full Changelog: https://github.com/huggingface/transformers/compare/v4.15.0...v4.16.0
[ImageGPT] Deprecate pixel_values input name to input_ids by @patrickvonplaten in https://github.com/huggingface/transformers/pull/14801
WavLM was proposed in WavLM: Large-Scale Self-Supervised Pre-Training for Full Stack Speech Processing by Sanyuan Chen, Chengyi Wang, Zhengyang Chen, Yu Wu, Shujie Liu, Zhuo Chen, Jinyu Li, Naoyuki Kanda, Takuya Yoshioka, Xiong Xiao, Jian Wu, Long Zhou, Shuo Ren, Yanmin Qian, Yao Qian, Jian Wu, Michael Zeng, Furu Wei.
WavLM sets a new SOTA on the SUPERB benchmark.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=wavlm
Wav2Vec2Phoneme was proposed in Simple and Effective Zero-shot Cross-lingual Phoneme Recognition by Qiantong Xu, Alexei Baevski, Michael Auli. Wav2Vec2Phoneme allows to do phoneme classification as part of automatic speech recognition
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=phoneme-recognition
Unispeech-SAT was proposed in UNISPEECH-SAT: UNIVERSAL SPEECH REPRESENTATION LEARNING WITH SPEAKER AWARE PRE-TRAINING by Sanyuan Chen, Yu Wu, Chengyi Wang, Zhengyang Chen, Zhuo Chen, Shujie Liu, Jian Wu, Yao Qian, Furu Wei, Jinyu Li, Xiangzhan Yu.
UniSpeech-SAT is especially good at speaker related tasks.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=unispeech-sat
Unispeech was proposed in UniSpeech: Unified Speech Representation Learning with Labeled and Unlabeled Data by Chengyi Wang, Yu Wu, Yao Qian, Kenichi Kumatani, Shujie Liu, Furu Wei, Michael Zeng, Xuedong Huang.
Three new models are released as part of the ImageGPT integration: ImageGPTModel, ImageGPTForCausalImageModeling, ImageGPTForImageClassification, in PyTorch.
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=unispeech
Wav2Vec2-like architecture now have a speaker diarization and speaker verification head added to their architectures. You can try out the new task here: https://huggingface.co/spaces/microsoft/wavlm-speaker-verification
require_datasets testing utility by @LysandreJik in https://github.com/huggingface/transformers/pull/14795stopping_criteria and logits_processor to generate by @lvwerra in https://github.com/huggingface/transformers/pull/14779FlaxMarianMTModel return block. by @sgugger in https://github.com/huggingface/transformers/pull/14873add_prefix_space and trim_offsets in backend_tokenizer.post_processor of RobertaTokenizerFast by @SaulLu in https://github.com/huggingface/transformers/pull/14752Full Changelog: https://github.com/huggingface/transformers/compare/v4.14.0...v4.15.0
Fixes a circular import when TensorFlow and Onnx are both installed
Fixes a circular import when TensorFlow and Onnx are both installed (#14787)
The Perceiver model was released in the previous version:
The Perceiver model was released in the previous version:
Perceiver
Eight new models are released as part of the Perceiver implementation:
PerceiverModel,PerceiverForMaskedLM,PerceiverForSequenceClassification,PerceiverForImageClassificationLearned,PerceiverForImageClassificationFourier,PerceiverForImageClassificationConvProcessing,PerceiverForOpticalFlow,PerceiverForMultimodalAutoencoding, in PyTorch.The Perceiver IO model was proposed in Perceiver IO: A General Architecture for Structured Inputs & Outputs by Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier Hénaff, Matthew M. Botvinick, Andrew Zisserman, Oriol Vinyals, João Carreira.
- Add Perceiver IO by @NielsRogge in https://github.com/huggingface/transformers/pull/14487
Compatible checkpoints can be found on the hub: https://huggingface.co/models?other=perceiver
Version v4.14.0 adds support for Perceiver in multiple pipelines, including the fill mask and sequence classification pipelines.
The Keras push to hub callback now generates model cards when pushing to the model hub. Additionally to the callback, model cards will be generated by default by the model.push_to_hub() method.
Fix : wrong link in the documentation (ConvBERT vs DistilBERT) by @Tikquuss in https://github.com/huggingface/transformers/pull/14705
Put back open in colab markers by @sgugger in https://github.com/huggingface/transformers/pull/14684
Fix doc examples: KeyError by @ydshieh in https://github.com/huggingface/transformers/pull/14699
Fix doc examples: 'CausalLMOutput...' object has no attribute 'last_hidden_state' by @ydshieh in https://github.com/huggingface/transformers/pull/14678
Adding Perceiver to AutoTokenizer. by @Narsil in https://github.com/huggingface/transformers/pull/14711
Fix doc examples: unexpected keyword argument by @ydshieh in https://github.com/huggingface/transformers/pull/14689
Automatically build doc notebooks by @sgugger in https://github.com/huggingface/transformers/pull/14718
Fix special character in MDX by @sgugger in https://github.com/huggingface/transformers/pull/14721
Fixing tests for perceiver (texts) by @Narsil in https://github.com/huggingface/transformers/pull/14719
[doc] document MoE model approach and current solutions by @stas00 in https://github.com/huggingface/transformers/pull/14725
[Flax examples] remove dependancy on pytorch training args by @patil-suraj in https://github.com/huggingface/transformers/pull/14636
Update bug-report.md by @patrickvonplaten in https://github.com/huggingface/transformers/pull/14715
[Adafactor] Fix adafactor by @patrickvonplaten in https://github.com/huggingface/transformers/pull/14713
Code parrot minor fixes/niceties by @ncoop57 in https://github.com/huggingface/transformers/pull/14666
Fix doc examples: modify config before super().init by @ydshieh in https://github.com/huggingface/transformers/pull/14697
Improve documentation of some models by @NielsRogge in https://github.com/huggingface/transformers/pull/14695
Skip Perceiver tests by @LysandreJik in https://github.com/huggingface/transformers/pull/14745
Add ability to get a list of supported pipeline tasks by @codesue in https://github.com/huggingface/transformers/pull/14732
Fix the perceiver docs by @LysandreJik in https://github.com/huggingface/transformers/pull/14748
[CI/pt-nightly] switch to cuda-11.3 by @stas00 in https://github.com/huggingface/transformers/pull/14726
Swap TF and PT code inside two blocks by @LucienShui in https://github.com/huggingface/transformers/pull/14742
Fix doc examples: cannot import name by @ydshieh in https://github.com/huggingface/transformers/pull/14698
Fix: change tooslow to slow by @ydshieh in https://github.com/huggingface/transformers/pull/14734
Small fixes for the doc by @sgugger in https://github.com/huggingface/transformers/pull/14751
Update transformers metadata by @sgugger in https://github.com/huggingface/transformers/pull/14724
Mention no images added to repository by @LysandreJik in https://github.com/huggingface/transformers/pull/14738
Avoid using tf.tile in embeddings for TF models by @ydshieh in https://github.com/huggingface/transformers/pull/14735
Change how to load config of XLNetLMHeadModel by @josutk in https://github.com/huggingface/transformers/pull/14746
Improve perceiver by @NielsRogge in https://github.com/huggingface/transformers/pull/14750
Convert Trainer doc page to MarkDown by @sgugger in https://github.com/huggingface/transformers/pull/14753
Update Table of Contents by @sgugger in https://github.com/huggingface/transformers/pull/14755
Fixing tests for Perceiver by @Narsil in https://github.com/huggingface/transformers/pull/14739
Make data shuffling in run_clm_flax.py respect global seed by @bminixhofer in https://github.com/huggingface/transformers/pull/13410
Adding support for multiple mask tokens. by @Narsil in https://github.com/huggingface/transformers/pull/14716
Fix broken links to distillation on index page of documentation by @amitness in https://github.com/huggingface/transformers/pull/14722
[doc] performance: groups of operations by compute-intensity by @stas00 in https://github.com/huggingface/transformers/pull/14757
Fix the doc_build_test job by @sgugger in https://github.com/huggingface/transformers/pull/14774
Fix preprocess_function in run_summarization_flax.py by @ydshieh in https://github.com/huggingface/transformers/pull/14769
Simplify T5 docs by @xhlulu in https://github.com/huggingface/transformers/pull/14776
Update Perceiver code examples by @NielsRogge in https://github.com/huggingface/transformers/pull/14783
Full Changelog: https://github.com/huggingface/transformers/compare/v4.13.0...v4.14.0
One column per quarter.