huggingface/transformers
62.4
Adequate · 25 October 2026
774k
lines of production code
Python
primary language
4
measurements over time
What this system is
This system is the Hugging Face Transformers library, a framework for loading, configuring, and running pre-trained machine learning models across text, vision, audio, and multimodal domains. It provides standardized interfaces for model inference, fine-tuning, and integration with external tools like quantization handlers and pipeline systems. The codebase supports diverse tasks such as natural language processing, speech recognition, and object detection, while maintaining infrastructure for distributed training and community governance.
How it got here
2018–2022 — v5 architecture migration and model expansion
121 changes.
This period focused on migrating the library to the v5 modular architecture, refactoring core models like BERT and RoBERTa to use unified configs, lazy loading, and a new cache system. Simultaneously, the project significantly expanded its model coverage by adding support for diverse architectures across NLP, vision, speech, and multimodal domains, while establishing robust CI and quality assurance tooling.
2023–2025 — multimodal expansion and MoE adoption
152 changes.
This period was defined by the rapid integration of diverse multimodal architectures, including extensive support for vision-language, audio-text, and video models, alongside a significant shift toward Mixture-of-Experts (MoE) language models. The library also expanded its infrastructure with native distributed training orchestration, unified quantization frameworks, and comprehensive benchmarking tools to support these complex, large-scale models.
2026 — multimodal expansion and MoE adoption
80 changes.
This period focused on integrating a vast array of new model architectures, with a strong emphasis on multimodal capabilities spanning vision, audio, video, and robotics. The codebase saw significant adoption of Mixture-of-Experts (MoE) designs and advanced attention mechanisms like sliding windows and sparse attention across numerous large language and vision-language models. Additionally, infrastructure improvements included a unified export framework, native GGUF support, and enhanced serving and benchmarking tools for continuous batching.
Features
Add A.X-K1 model support
Adds the A.X-K1 model from SK Telecom, an Mixture-of-Experts LLM based on the DeepSeek-V3 architecture. This change introduces the AXK1Config, AXK1Model, and AXK1ForCausalLM classes, along with the necessary configuration and modeling files. The model implements Multi-head Latent Attention (MLA) and a grouped sigmoid top-k MoE with a shared expert, featuring a single architectural modification: an extra post-MLP layer normalization applied to the MoE block output. Users can now load and run models using the 'axk1' model type.
src/transformers/models/axk1 · high confidence
Add A.X-K2 model support
Users can now load and run the A.X-K2 model (checkpoint: skt/A.X-K2) via the Hugging Face Transformers library. This new architecture features DeepSeek-V3-style Mixture-of-Experts (MoE) with grouped routing, DeepSeek Sparse Attention (DSA) using a dedicated indexer for top-k token selection, and low-rank query projections (MLA). The implementation includes configuration options for expert grouping, sparse attention parameters, and gated normalization, enabling efficient inference and training for this specific model family.
src/transformers/models/axk2 · high confidence
Add ALIGN model for image-text alignment
Introduces the ALIGN model, a multimodal architecture that aligns image and text representations using contrastive learning. This change adds the \AlignModel\, \AlignTextModel\, and \AlignVisionModel\ classes, along with their corresponding configurations (\AlignConfig\, \AlignTextConfig\, \AlignVisionConfig\) and the \AlignProcessor\ for handling image and text inputs. A conversion script is also provided to load checkpoints from the original TensorFlow implementation, enabling users to leverage pre-trained ALIGN models for tasks requiring joint image-text understanding.
src/transformers/models/align · high confidence
Add Aimv2 model for image-text similarity
Introduces the Aimv2 model, a vision-language architecture supporting both vision-only and multimodal (image-text) tasks. The implementation includes configuration classes (Aimv2Config, Aimv2VisionConfig, Aimv2TextConfig), the core modeling logic (Aimv2Model, Aimv2VisionModel, Aimv2TextModel), and a conversion script to load original Apple checkpoints into the Hugging Face format. Users can now load and run Aimv2 models for tasks like image-text retrieval and similarity scoring.
src/transformers/models/aimv2 · high confidence
Add Apple's DepthPro model for depth estimation
Introduces a new DepthPro model for monocular depth estimation, including the configuration, image processor, and PyTorch implementation. The model uses a Dinov2 backbone and supports field-of-view estimation. A weight conversion script is provided to load original Apple checkpoints into the Hugging Face format.
_src/transformers/models/depth\pro · high confidence
Add Audio Spectrogram Transformer (AST) model support
Users can now load and run the Audio Spectrogram Transformer for audio classification tasks. This change introduces the ASTConfig, ASTFeatureExtractor (which computes mel-filter bank features using TorchAudio or NumPy), and the ASTModel/ASTForAudioClassification PyTorch implementations. A conversion script is also provided to migrate checkpoints from the original AST repository, supporting pre-trained models on AudioSet and Speech Commands v2.
_src/transformers/models/audio\_spectrogram\transformer · high confidence
Add AudioFlamingo3 model integration
Introduces the AudioFlamingo3 model, a multimodal architecture combining a fine-tuned Whisper encoder for audio processing with a Qwen2 language model for text generation. This release includes the model implementation, configuration classes, a processor for handling audio and text inputs, and a conversion script to load NVIDIA's AudioFlamingo3 checkpoints into the Hugging Face format.
src/transformers/models/audioflamingo3 · high confidence
Add Autoformer time-series model
Introduces the Autoformer model for time-series forecasting, including the \AutoformerConfig\ configuration class, the \AutoformerModel\ implementation with encoder-decoder architecture and autocorrelation mechanisms, and associated utilities like feature embedders and scalers. Users can now load and run Autoformer models via the standard Hugging Face Transformers API for tasks such as multivariate and univariate time-series prediction.
src/transformers/models/autoformer, src/transformers/models/patchtsmixer · high confidence
Add BARTpho tokenizer for Vietnamese
Users can now tokenize Vietnamese text using the BARTpho model. This change introduces the \BartphoTokenizer\ class, which is based on SentencePiece and utilizes both a multilingual vocabulary (from XLM-RoBERTa) and a specialized monolingual Vietnamese vocabulary to handle syllable-level tokenization.
src/transformers/models/bartpho · high confidence
Add BERTweet tokenizer with lazy module support
The BERTweet tokenizer is now available as a Python-based implementation (\BertweetTokenizer\) that inherits from \PreTrainedTokenizer\. It supports Byte-Pair Encoding with configurable normalization and optional emoji demojization (via the \emoji\ library). The model is exposed through a lazy-loading \\_\init\\_.py\ module, allowing users to import \BertweetTokenizer\ without immediate overhead.
src/transformers/models/bertweet · high confidence
Add BEiT vision model support
Introduces the BEiT (Bert-like Image Transformer) model to the library, enabling users to load and run BEiT architectures for tasks such as image classification, masked image modeling, and semantic segmentation. This change adds the \BeitConfig\, \BeitImageProcessor\ (with both Torchvision and PIL backends), and the core \BeitModel\ implementation, along with a conversion script to migrate checkpoints from the original UNIL repository.
(repo-wide) · high confidence
Add BLIP model support for image-text tasks
Introduces the BLIP (Bootstrapping Language-Image Pre-training) model, enabling users to perform image captioning, visual question answering, and image-text retrieval. This addition includes the core \BlipModel\ with vision and text encoders, specialized heads (\BlipForConditionalGeneration\, \BlipForQuestionAnswering\, \BlipForImageTextRetrieval\), and a unified \BlipProcessor\ for handling image and text inputs. A conversion script is also provided to migrate weights from the original Salesforce BLIP implementation to the Hugging Face Transformers format.
src/transformers/models/blip · high confidence
Add BROS model for document layout understanding
Introduces the BROS model, a PyTorch implementation for document layout analysis that processes text alongside bounding box coordinates. This change adds the core model architecture, configuration, and processor classes to the library, along with a conversion script to migrate checkpoints from the original BROS repository to Hugging Face format.
src/transformers/models/bros · high confidence
Add Barthez tokenizer
Users can now tokenize text for the Barthez model using the new \BarthezTokenizer\. This fast tokenizer is built on the Tokenizers library with a Unigram model and SentencePiece-style processing, supporting standard special tokens and configuration options like \add\_prefix\_space\.
src/transformers/models/barthez · high confidence
Add BiT (Big Transfer) model support
Users can now load and run the BiT model for image classification and feature extraction. This change introduces the \BitModel\, \BitConfig\, and \BitImageProcessor\ classes, along with a conversion script to import checkpoints from the \timm\ library. The model supports both PyTorch and PIL backends for image processing and includes configuration options for layer types, padding strategies, and output indices.
src/transformers/models/bit · high confidence
Add BigBird model support
Introduces the BigBird transformer model, including its configuration, PyTorch implementation, and fast tokenizer. This enables users to load and run BigBird models (such as google/bigbird-roberta-base) for tasks like masked language modeling, question answering, and sequence classification, with support for block-sparse attention and conversion from original TensorFlow checkpoints.
_src/transformers/models/big\bird · high confidence
Add BigBirdPegasus model support
Users can now load and run the BigBirdPegasus model for long-document sequence-to-sequence tasks. This change introduces the model configuration, PyTorch implementation, and a TensorFlow-to-PyTorch checkpoint converter, enabling the use of BigBird's block-sparse attention mechanism for efficient processing of long sequences.
_src/transformers/models/bigbird\pegasus · high confidence
Add BlenderbotSmall model support
Introduces the BlenderbotSmall model architecture, configuration, and tokenizer to the library. Users can now load and run the 90M parameter encoder-decoder model (facebook/blenderbot\_small-90M) for sequence-to-sequence tasks, including text generation and translation, using the standard \BlenderbotSmallModel\, \BlenderbotSmallForCausalLM\, and \BlenderbotSmallTokenizer\ classes.
_src/transformers/models/blenderbot\small · high confidence
Add BridgeTower multimodal model
Introduces the BridgeTower model, a multimodal architecture that combines vision and text encoders with cross-modal transformer layers. This release includes the core PyTorch implementation (\BridgeTowerModel\, \BridgeTowerForContrastiveLearning\, \BridgeTowerForMaskedLM\, and \BridgeTowerForImageAndTextRetrieval\), configuration classes (\BridgeTowerConfig\, \BridgeTowerVisionConfig\, \BridgeTowerTextConfig\), and dedicated image processors supporting both Torchvision and PIL backends with custom resizing and padding logic. A unified \BridgeTowerProcessor\ is also provided to handle joint text and image tokenization and preprocessing.
src/transformers/models/bridgetower, src/transformers/models/instructblipvideo, src/transformers/models/modernvbert · high confidence
Add ByteDance Seed Seed-OSS model support
Users can now load and run the ByteDance Seed Seed-OSS model (e.g., Seed-OSS-36B-Instruct) using the Hugging Face Transformers library. This new model type includes a dedicated configuration (\SeedOssConfig\) and PyTorch implementation (\SeedOssModel\, \SeedOssForCausalLM\, etc.) that leverages Llama-based components for attention, MLP, and normalization, while supporting features like rotary position embeddings, tensor parallelism plans, and various downstream heads (sequence classification, token classification, question answering).
_src/transformers/models/seed\oss · high confidence
Add CHMv2 depth estimation model
Introduces the CHMv2 (Canopy Height Model v2) model for depth estimation, including its configuration, image processor, and PyTorch implementation. The model uses a DINOv3 ViT backbone and a DPT-style head to predict depth maps, with support for converting original Meta checkpoints to Hugging Face format.
src/transformers/models/chmv2 · high confidence
Add CLAP model for audio-text similarity
Introduces the CLAP (Contrastive Language-Audio Pretraining) model, enabling users to compute similarity scores between audio and text inputs. This addition includes the \ClapModel\ and its sub-components (\ClapTextModel\, \ClapAudioModel\), along with \ClapConfig\, \ClapFeatureExtractor\, and \ClapProcessor\. A conversion script is also provided to migrate checkpoints from the original LAION-CLAP implementation to the Hugging Face format.
src/transformers/models/clap · high confidence
Add CLIPSeg model for zero-shot image segmentation
Introduces the CLIPSeg model, enabling zero-shot image segmentation by combining CLIP's text and vision encoders with a decoder. Users can now load \CLIPSegForImageSegmentation\ and \CLIPSegProcessor\ to segment images based on text prompts or visual prompts, with support for converting original PyTorch checkpoints and using modular configuration classes.
src/transformers/models/clipseg · high confidence
Add CLVP model support for speech-text contrastive learning and generation
Introduces the CLVP (Contrastive Language-Video Pretraining, adapted for speech) model architecture, including its configuration, PyTorch implementation, tokenizer, feature extractor, and processor. This addition enables users to load and run CLVP models for tasks such as speech-text similarity matching and conditional text generation from audio, with a provided conversion script to migrate weights from the original Tortoise TTS v2 repository.
src/transformers/models/clvp · high confidence
Add CPM tokenizer support
Users can now tokenize text for CPM models using the new CpmTokenizer and CpmTokenizerFast classes, which integrate Jieba-RS for segmentation and SentencePiece for vocabulary processing.
src/transformers/models/cpm · high confidence
Add CSM model for audio-text generation
Introduces the CSM model, a new architecture for conditional audio-text generation. This includes the model implementation (backbone and depth decoder), configuration classes, a custom processor for handling audio and text inputs, and a specialized generation mixin that manages the multi-step sampling process between the backbone and depth decoder components.
src/transformers/models/csm · high confidence
Add Code World Model (CWM) support
Introduces the Code World Model (CWM), a new architecture for code generation tasks. The model features a sliding-window attention mechanism that alternates between full and sliding attention patterns across layers, configurable via \layer\_types\. It supports a maximum context length of 131,072 tokens and includes specific tensor parallel and pipeline parallel distribution plans in its configuration for efficient distributed training and inference.
src/transformers/models/cwm · high confidence
Add CodeLlama tokenizer with prompt infilling support
Introduces the \CodeLlamaTokenizer\ class, enabling tokenization for Meta's CodeLlama models. This tokenizer supports prompt infilling via special tokens (prefix, middle, suffix, eot) and includes a configurable default system prompt for instruction-tuned variants.
_src/transformers/models/code\llama · high confidence
Add Cohere2Moe model support
Introduces the \Cohere2Moe\ model, a Mixture-of-Experts (MoE) architecture from Cohere. This addition includes the \Cohere2MoeConfig\ for configuration (e.g., expert counts, RoPE settings), the \Cohere2MoeModel\ and \Cohere2MoeForCausalLM\ implementations featuring sparse MoE blocks with top-k routing and shared experts, and modular definitions for reuse. The model supports tensor parallelism and expert parallelism plans, and is available via the \transformers\ library.
_src/transformers/models/cohere2\moe · high confidence
Add Cohere2Vision multimodal model support
Introduces the Cohere2Vision model (Command-A-Vision), a multimodal architecture combining a Siglip vision encoder with a Cohere2 language model. Users can now load the model via \AutoModel\ and \AutoProcessor\ using the \CohereLabs/command-a-vision-07-2025\ checkpoint. The implementation includes a custom image processor that supports tiling images into patches (up to 12) and a processor that handles specific multimodal tokenization (BOI/EOI tokens). The model supports Flash Attention and standard generation workflows.
_src/transformers/models/cohere2\vision · high confidence
Add CohereCompass multimodal model support
Introduces the CohereCompass model, a multimodal architecture supporting both image and video inputs. This change adds the model implementation, configuration classes (vision, text, and combined), and dedicated processors for images, videos, and text. The model utilizes a vision encoder with deepstack embeddings and a text decoder with sliding window attention, enabling users to load and run Cohere's North-Micro-Vision-Instruct style models for conditional generation tasks involving visual media.
_src/transformers/models/cohere\compass · high confidence
Add ColModernVBert model for visual document retrieval
Introduces the ColModernVBert model, a multi-modal architecture that leverages Vision Language Models (VLMs) to create efficient multi-vector embeddings directly from document images for retrieval tasks. This addition includes the model configuration (\ColModernVBertConfig\), the retrieval model implementation (\ColModernVBertForRetrieval\), and a dedicated processor (\ColModernVBertProcessor\) to handle the tokenization and image preprocessing required for this late-interaction approach.
src/transformers/models/colmodernvbert · high confidence
Add ColPali model for document retrieval
Adds the ColPali model, a vision-language model designed for efficient document retrieval using multi-vector embeddings. This includes the model implementation (\ColPaliForRetrieval\), which wraps a PaliGemma base model with a projection layer to produce L2-normalized embeddings, and a custom processor (\ColPaliProcessor\) that handles image and text inputs with specific prefixes and suffixes for queries and document pages. A weight conversion script is also provided to migrate models from the original ColPali repository to the Hugging Face format.
src/transformers/models/colpali, src/transformers/models/colqwen2 · high confidence
Add ConvNeXt V2 model support
Adds the ConvNeXt V2 architecture to the library, including the model implementation, configuration, and a conversion script for weights from the original Meta repository. Users can now load and run ConvNeXt V2 models for image classification and feature extraction tasks.
src/transformers/models/convnextv2 · high confidence
Add CvT (Convolutional Vision Transformer) model
Introduces the CvT model, a vision transformer that uses convolutional operations for self-attention. This change adds the model implementation (\modeling\_cvt.py\), configuration (\configuration\cvt.py\), and module exports (\\\init\\_.py\) to the library. It also includes a conversion script (\convert\_cvt\_original\_pytorch\_checkpoint\_to\_pytorch.py\) to load weights from the original Microsoft CvT repository, enabling users to fine-tune or use pre-trained CvT models for image classification and feature extraction tasks.
src/transformers/models/cvt · high confidence
Add DFine object detection model
Introduces the DFine model for object detection, including its configuration, modular definition, and eager-mode implementation. The model supports a configurable backbone (defaulting to hgnet\_v2) and a transformer-based decoder with features like contrastive denoising, iterative bounding box refinement, and distribution-guided localization. A checkpoint conversion script is provided to load original PyTorch weights (e.g., from COCO or Objects365 pre-trained variants) into the Hugging Face format, and the model is registered in the library's auto-mapping for easy instantiation.
_src/transformers/models/d\fine · high confidence
Add DINOv3 Vision Transformer model support
Introduces the DINOv3 ViT model, including its configuration, image processor, and PyTorch implementation, along with a conversion script to load pretrained checkpoints from the original Meta repository. Users can now instantiate and run DINOv3 models using the standard Hugging Face Transformers API, with support for backbone features and class tokens.
_src/transformers/models/dinov3\vit, src/transformers/models/hiera · high confidence
Add DPT model support for depth estimation and semantic segmentation
Introduces the DPT (Dense Prediction Transformers) model architecture, enabling depth estimation and semantic segmentation tasks. This change adds the core model implementation, configuration, and image processing components, along with conversion scripts to load pretrained checkpoints from the original MiDaS repository (including DPT-Hybrid, DPT-BeiT, DPT-SwinV2, and DPT-DINOv2 variants).
src/transformers/models/dpt · high confidence
Add DeepSeek Janus multimodal model support
Adds the DeepSeek Janus model to the library, enabling users to load, configure, and run inference with Janus-Pro-1B for both text and image generation. This includes the \JanusForConditionalGeneration\ model class, \JanusConfig\ with sub-configs for vision, VQ-VAE, and text components, and dedicated \JanusImageProcessor\ and \JanusProcessor\ classes for handling multimodal inputs. A weight conversion script is also provided to convert DeepSeek's original model weights to the Hugging Face Transformers format, and the model supports Flash Attention and torch.compile.
src/transformers/models/janus · high confidence
Add DeepSeek-OCR-2 multimodal model support
Adds the DeepSeek-OCR-2 model, a multimodal architecture for optical character recognition that combines a SAM-based vision encoder with a DeepSeek V2-style text decoder. This change introduces the full model implementation, including configuration classes, a modular definition, and a PyTorch modeling file, alongside dedicated image processors (Torchvision and PIL backends) that handle optimal tiled patch extraction. It also provides a unified processor for text and image tokenization, a weight conversion script to migrate from the original custom-code format, and the necessary module exports to make the model available via the Hugging Face Transformers library.
_src/transformers/models/deepseek\_ocr2, src/transformers/models/got\ocr2 · high confidence
Add DeepSeek-V3.2-Exp model with DeepSeek Sparse Attention (DSA)
Introduces the DeepSeek-V3.2-Exp model, which extends DeepSeek-V3 by integrating DeepSeek Sparse Attention (DSA). This new architecture adds a lightweight indexer to each attention layer that scores queries against cached keys to select the top-k tokens, creating an additive sparse mask for efficient attention. The model retains DeepSeek-V3's Mixture of Experts (MoE) structure and Multi-Latent Attention (MLA) but configures the first few layers as dense MLPs before switching to sparse MoE layers. Users can now load and run this specific experimental variant using the \deepseek-ai/DeepSeek-V3.2-Exp\ checkpoint.
_src/transformers/models/deepseek\v32 · high confidence
Add DeepseekVL Hybrid model support
Introduces the DeepseekVL Hybrid model, a multimodal architecture that combines a low-resolution Siglip vision encoder, a high-resolution SAM vision encoder, and a Llama text model. This change adds the model implementation, configuration, image processors (with both Torchvision and PIL backends), processor, and a weight conversion script to the library, enabling users to load and run Deepseek's hybrid vision-language models.
_src/transformers/models/deepseek\_vl\hybrid · high confidence
Add Descript-Audio-Codec (DAC) model support
Users can now load and run the Descript-Audio-Codec model for audio tokenization and reconstruction. This change introduces the \DacModel\, \DacConfig\, and \DacFeatureExtractor\ classes, along with a script to convert official Descript checkpoints into the Hugging Face format, enabling seamless integration of this audio codec into the Transformers library.
src/transformers/models/dac · high confidence
Add Dia model for text-to-speech generation
Introduces the Dia model, a multimodal encoder-decoder architecture designed for text-to-speech synthesis. This addition includes the \DiaConfig\ (with nested encoder and decoder configurations), \DiaModel\ implementation featuring multi-channel audio embeddings and cross-attention, and a \DiaProcessor\ that integrates audio feature extraction, tokenization, and the DAC audio tokenizer. The model supports custom generation logic via \DiaGenerationMixin\, including classifier-free guidance and specific EOS/delay-pattern logits processing, along with a conversion script to migrate Nari Labs checkpoints to the Hugging Face format.
src/transformers/models/dia · high confidence
Add Dilated Neighborhood Attention Transformer (DiNAT) model
Users can now use the DiNAT architecture for vision tasks. This change introduces the \DinatModel\, \DinatConfig\, and \DinatImageClassifier\ classes, along with the necessary \\_\init\\_.py\ exports. The implementation relies on the \natten\ library for Neighborhood Attention operations and supports configuration of patch size (currently limited to 4), dilation rates, and backbone output indices/features.
src/transformers/models/dinat · high confidence
Add Doge small language model support
Introduces the Doge family of small language models (e.g., Doge-320M) to the library. This includes the \DogeConfig\ for model configuration, the \DogeModel\ and \DogeForCausalLM\ implementations, and a weight conversion script to migrate existing Doge checkpoints to the Hugging Face format. The model supports features such as dynamic sliding window attention, rotary position embeddings, and tensor parallelism plans.
src/transformers/models/doge · high confidence
Add ESMFold utility module for protein structure processing
A new \openfold\_utils\ package has been added to the ESM model location, providing core utilities for protein structure representation and manipulation. This includes a \Protein\ dataclass for handling atom positions and masks, functions to convert between atom14 and atom37 coordinate systems, rigid body transformation utilities for 3D geometry, and loss computation functions for predicted aligned error and TM-score.
_src/transformers/models/esm/openfold\utils · high confidence
Add EXAONE 4.0 model support
Users can now load and run the LG AI Research EXAONE 4.0 model (e.g., EXAONE-4.0-32B) using the \Exaone4Model\ and \Exaone4Config\ classes. The implementation supports sliding window attention with configurable patterns, QK-normalization, and includes default tensor-parallel and pipeline-parallel plans for distributed inference.
src/transformers/models/exaone4 · high confidence
Add EXAONE 4.5 multimodal model support
Introduces the Exaone4\_5 model, a multimodal architecture combining the Exaone4 text backbone with a vision encoder derived from Qwen2.5-VL. Users can now load the LGAI-EXAONE/EXAONE-4.5-33B checkpoint via AutoModel and AutoConfig, and process images and videos using the new Exaone4\_5\_Processor. The implementation includes specific vision components like axial RoPE embeddings and a custom vision attention layer, while ensuring backward compatibility for legacy configuration types.
_src/transformers/models/exaone4\5 · high confidence
Add EdgeTAM video segmentation model
Introduces the EdgeTAM model for video object segmentation, including the \EdgeTamVideoModel\ class, \EdgeTamVideoConfig\ (with sub-configs for prompt encoder and mask decoder), and the \EdgeTamVideoProcessor\. A conversion script is provided to load checkpoints from the original Facebook Research repository, mapping keys to the Hugging Face format. The model supports point, box, and mask prompts for interactive segmentation and tracking across video frames.
_src/transformers/models/edgetam\video · high confidence
Add EfficientLoFTR keypoint matching model
Introduces the EfficientLoFTR model for keypoint matching, including the \EfficientLoFTRConfig\, \EfficientLoFTRForKeypointMatching\ model class, and image processors (\EfficientLoFTRImageProcessor\ and \EfficientLoFTRImageProcessorPil\) that handle grayscale conversion and resizing of image pairs. A conversion script is also provided to migrate weights from the original \stevenbucaille/efficient\_loftr\_pth\ checkpoint to the Hugging Face format.
src/transformers/models/efficientloftr · high confidence
Add EnCodec audio tokenizer model
Introduces the EnCodec model for audio tokenization, including the \EncodecConfig\, \EncodecFeatureExtractor\, and \EncodecModel\ classes, along with a script to convert Meta's original checkpoints to the Hugging Face format. This enables users to encode audio into discrete code embeddings and decode them back to waveforms, supporting both 24kHz and 48kHz sampling rates with configurable bandwidths and chunking strategies.
src/transformers/models/encodec · high confidence
Add EoMT with DINOv3 backbone for universal segmentation
Introduces the EoMT-DINOv3 model, a universal segmentation architecture that combines the EoMT decoder with the DINOv3 vision transformer backbone. This change adds the model configuration, modular and eager implementations, and a conversion script to load official checkpoints from the \tue-mps\ and \facebook\ repositories. Users can now perform panoptic, instance, and semantic segmentation tasks using pretrained DINOv3 features with the EoMT framework.
_src/transformers/models/eomt\dinov3 · high confidence
Add Ernie 4.5 MoE model support
Users can now load and run the Ernie 4.5 MoE model (checkpoint: baidu/ERNIE-4.5-21B-A3B-PT) via the new \Ernie4\_5\_MoeModel\ and \Ernie4\_5\_MoeConfig\ classes. The implementation includes a Mixture-of-Experts architecture with configurable expert counts, routing, and shared experts, along with built-in support for tensor parallelism (TP) and expert parallelism (EP) plans defined in the configuration.
_src/transformers/models/ernie4\_5\moe · high confidence
Add Ernie 4.5 VL MoE multimodal model support
Adds the Ernie 4.5 VL MoE model, a vision-language model with a Mixture-of-Experts (MoE) text backbone and a Qwen2.5-VL-style vision encoder. This release includes the modular definition, auto-generated PyTorch modeling, configuration classes (vision, text, and main), image and video processors (with both Torchvision and PIL backends), a unified processor handling multimodal tokenization and modality-specific type IDs, and a conversion script to load Baidu's original checkpoints into Hugging Face format.
_src/transformers/models/ernie4\_5\_vl\moe · high confidence
Add Ernie 4.5 text model support
Users can now load and run Baidu's Ernie 4.5 models using the Hugging Face Transformers library. This change introduces the \Ernie4\_5Config\, \Ernie4\_5Model\, and \Ernie4\_5ForCausalLM\ classes, along with a tokenizer conversion script to bridge the original Baidu tokenizer format. The implementation supports a vocabulary size of 103,424, a maximum sequence length of 131,072, and features like Rotary Position Embeddings (RoPE) and Gated Linear Units (GLU) for the MLP layers.
_src/transformers/models/ernie4\5 · high confidence
Add Evolla model support for protein-language integration
Introduces the Evolla model, a multimodal architecture combining a protein encoder (SaProt) with a Llama-based text decoder. This change adds the configuration (\EvollaConfig\, \SaProtConfig\), modular and eager implementations (\modeling\_evolla.py\, \modular\_evolla.py\), and a dedicated processor (\processing\_evolla.py\) to handle amino acid sequences and foldseek data alongside text prompts, enabling users to run inference on the westlake-repl/Evolla-10B-hf checkpoint.
src/transformers/models/evolla · high confidence
Add FalconMamba model support
Users can now load and run the FalconMamba architecture (e.g., tiiuae/falcon-mamba-7b) via \FalconMambaModel\ and \FalconMambaForCausalLM\. The implementation includes a dedicated \FalconMambaConfig\ with Mamba-specific settings (such as \use\_mambapy\ and \use\_associative\_scan\), a \FalconMambaMixer\ that supports fused kernel acceleration with PyTorch fallbacks, and generation capabilities via \GenerationMixin\.
_src/transformers/models/falcon\mamba · high confidence
Add FastSpeech2Conformer text-to-speech model
Introduces the FastSpeech2Conformer model for text-to-speech synthesis, including the core \FastSpeech2ConformerModel\, a \FastSpeech2ConformerWithHifiGan\ variant that chains a HiFi-GAN vocoder for waveform generation, and the \FastSpeech2ConformerTokenizer\ which uses \g2p-en\ for phonemization. The release also provides conversion scripts to migrate original Espnet checkpoints to the Hugging Face format, enabling users to load pre-trained models and generate speech directly.
_src/transformers/models/fastspeech2\conformer · high confidence
Add FastVLM model support
Introduces a new FastVLM model architecture, including its configuration, modular definition, and concrete PyTorch implementation, along with a script to convert original FastVLM weights to the Hugging Face format. Users can now load and run FastVLM models (e.g., KamilaMila/FastVLM-7B) using standard Transformers APIs, with automatic handling of vision and text sub-configs and a dedicated weight converter for migration from existing checkpoints.
_src/transformers/models/fast\vlm · high confidence
Add FlexOlmo model support
Introduces the FlexOlmo model architecture, a Mixture-of-Experts (MoE) language model based on the \allenai/FlexOlmo-7x7B-1T\ checkpoint. The implementation combines components from the Olmo2 and OlmoE models, featuring a decoder layer structure where layer normalization is applied after attention and feedforward operations (post-norm). It includes specific configurations for Tensor Parallelism (TP), Pipeline Parallelism (PP), and Expert Parallelism (EP) to support distributed training and inference.
_src/transformers/models/flex\olmo · high confidence
Add Florence-2 multimodal model support
Users can now load and run the Florence-2 model for vision-language tasks such as OCR, object detection, and image captioning. This change introduces the Florence2Config, Florence2VisionConfig, Florence2Processor, and the main Florence2ForConditionalGeneration model class, along with a conversion script to migrate weights from the original Microsoft PyTorch implementation to the Hugging Face format.
src/transformers/models/florence2 · high confidence
Add FocalNet model for image classification and feature extraction
Introduces the FocalNet model, a vision architecture from Microsoft Research, to the library. This addition includes the model implementation, configuration, and a conversion script to load pretrained checkpoints from the original FocalNet repository. Users can now utilize FocalNet for image classification tasks and as a backbone for feature extraction, with support for various model sizes (tiny, small, base, large, xlarge, huge) and configurations.
src/transformers/models/focalnet · high confidence
Add Fun-ASR-Nano model for speech transcription
Users can now load and run the Fun-ASR-Nano model (checkpoint: FunAudioLLM/Fun-ASR-Nano-2512-hf) for speech-to-text tasks. This new model includes a dedicated feature extractor that computes Kaldi-compatible mel-filterbank features with Low Frame Rate processing, a processor that supports structured transcription requests with language, prompt, and keyword inputs, and a conversion script to migrate original FunASR checkpoints to the Hugging Face format.
_src/transformers/models/fun\_asr\nano · high confidence
Add Funnel Transformer model support
Users can now load and run the Funnel Transformer architecture using the Hugging Face Transformers library. This change introduces the \FunnelConfig\ for model configuration, the \FunnelTokenizer\ for text processing, and the PyTorch \FunnelModel\ implementation. It also includes a conversion script to migrate pre-trained TensorFlow checkpoints to PyTorch, enabling the use of existing Funnel Transformer weights for tasks such as masked language modeling, sequence classification, and question answering.
src/transformers/models/funnel · high confidence
Add GIT (Generative Image-to-Text) model support
Users can now load and run the Microsoft GIT model for image captioning and visual question answering. This change introduces the GitConfig and GitVisionConfig classes, the GitModel and GitForCausalLM implementations, a unified GitProcessor for handling image and text inputs, and a conversion script to migrate checkpoints from the original Microsoft repository to the Hugging Face format.
src/transformers/models/git · high confidence
Add GLM-4 model support
Users can now load and run GLM-4 models (e.g., THUDM/GLM-4-9B-0414) using the standard Hugging Face Transformers API. This change introduces the Glm4Config, Glm4ForCausalLM, Glm4ForSequenceClassification, and Glm4ForTokenClassification classes, along with a weight conversion script to migrate existing GLM-4 checkpoints to the Hugging Face format. The implementation supports causal language modeling, sequence classification, and token classification tasks, leveraging the modular architecture and existing GLM/Phi3 components for attention and MLP layers.
_src/transformers/models/glm4, src/transformers/models/glm4\_moe, src/transformers/models/glm4\_moe\lite · high confidence
Add GLM-4.1V multimodal model support
Introduces the GLM-4.1V model, a vision-language architecture supporting both image and video inputs. This change adds the core model implementation, configuration classes (Glm4vConfig, Glm4vVisionConfig, Glm4vTextConfig), and dedicated processors for images and videos. It also includes a weight conversion script to migrate models from the Megatron format to the Hugging Face Transformers format, enabling users to load and run GLM-4.1V for conditional generation tasks.
src/transformers/models/glm4v · high confidence
Add GLM-4.5V multimodal MoE model support
Users can now load and generate with the GLM-4.5V multimodal mixture-of-experts model via \Glm4vMoeForConditionalGeneration\ and \Glm4vMoeConfig\. This location provides the model implementation, configuration classes (including vision and text sub-configs), and a weight conversion script for Megatron-format checkpoints. The model supports image and video inputs, uses a Mixture-of-Experts architecture with expert parallelism plans, and includes specialized rotary position embeddings for multimodal token grids.
_src/transformers/models/glm4v\moe · high confidence
Add GLM-4.6V multimodal model support
Users can now load and run the GLM-4.6V vision-language model using the standard Hugging Face Transformers API. This new model supports both image and video inputs, featuring a dedicated processor that handles frame sampling and timestamp-based video structuring, image/video processors with dynamic resizing and patchification, and a configuration that automatically inherits text and vision sub-configs from the existing GLM-4V architecture.
src/transformers/models/glm46v · high confidence
Add GLM-5.3 Flash model support
Users can now load and run the GLM-5.3 Flash model (zai-org/GLM-5.3-Flash) using the new \Glm5Next\ implementation. This adds a new multimodal model type (\glm5\_next\_text\) featuring a Mixture of Experts (MoE) architecture with 288 routed experts, linear attention layers, and a Dynamic Sparse Attention (DSA) indexer. The release includes full support for image and video inputs via dedicated processors and image/video processors, along with configuration options for per-layer attention schedules and expert routing.
_src/transformers/models/glm5\next · high confidence
Add GLM-ASR model support
Users can now load and run the GLM-ASR automatic speech recognition model from the Hugging Face Hub. This change introduces the \GlmAsrConfig\, \GlmAsrForConditionalGeneration\ model class, and \GlmAsrProcessor\ to the library, along with a weight conversion script to migrate checkpoints from the original \zai-org/GLM-ASR-Nano-2512\ repository. The model supports audio transcription via a chat-template-based processor that handles audio chunking and tokenization.
src/transformers/models/glmasr · high confidence
Add GLM-GA model support with image and video processors
Adds the GLM-GA model variant, including its configuration, modular definition, and dedicated image and video processors. The configuration defines specific token IDs for image and video start/end markers and references the underlying GLM-4.6V text and vision sub-configs. The new processors handle image and video preprocessing, including smart resizing, patchification, and frame sampling, while reusing the GLM-4.6V modeling implementation.
src/transformers/models/glmga · high confidence
Add GLPN model for monocular depth estimation
Introduces the GLPN (Global-Local Path Networks) model, enabling monocular depth estimation from single images. This change adds the core PyTorch implementation (\modeling\_glpn.py\), a dedicated configuration class (\configuration\_glpn.py\), and two image processors (\GLPNImageProcessor\ and \GLPNImageProcessorPil\) that handle resizing to multiples of a size divisor and rescaling. A conversion script (\convert\_glpn\_to\pytorch.py\) is also provided to migrate existing GLPN checkpoints to the Hugging Face format, and the model is registered in the package \\\init\\_.py\ for immediate use.
src/transformers/models/glpn, src/transformers/models/zoedepth · high confidence
Add GPT-J model support
Users can now load and run the GPT-J-6B architecture using the Hugging Face Transformers library. This change introduces the GPTJConfig, the PyTorch modeling implementation (GPTJModel, GPTJForCausalLM, etc.), and the necessary module exports, enabling features such as causal language modeling, sequence classification, and question answering for this specific model family.
src/transformers/models/gptj · high confidence
Add GPT-OSS and OpenAI Privacy Filter model support
Introduces native support for the GPT-OSS model architecture, including its configuration, modular and concrete modeling files, and a weight conversion script. Additionally, adds the OpenAI Privacy Filter model, which is built on the GPT-OSS backbone, providing its configuration, modeling implementation, and conversion utilities. Users can now load and run these specific OpenAI models using the standard Hugging Face Transformers API.
_src/transformers/models/gpt\oss · high confidence
Add GPTBigCode model support
Introduces the GPTBigCode model (based on the SantaCoder architecture) to the library, including its configuration, modeling implementation, and module exports. This adds a new capability for users to load, run, and fine-tune BigCode's GPT-style language models using the standard Hugging Face Transformers API.
_src/transformers/models/gpt\bigcode · high confidence
Add GPTNeoX Japanese model support
Users can now load and run the GPT-NeoX Japanese model (e.g., abeja/gpt-neox-japanese-2.7b) using the new GPTNeoXJapaneseConfig, GPTNeoXJapaneseModel, and GPTNeoXJapaneseTokenizer classes. The model implements a custom subword tokenizer for Japanese text, supports rotary position embeddings with partial rotary factors, and is compatible with torch.compile and dynamic cache generation.
_src/transformers/models/gpt\_neox\japanese · high confidence
Add Granite 4.1 Vision model support
Introduces the Granite 4.1 Vision multimodal model, including its configuration, modular and concrete modeling implementations, and a dedicated processor. The model combines a Granite text backbone with a CLIP vision encoder and a Window Q-Former projector, supporting features like deepstack feature injection, spatial sampling, and configurable image grid resolutions for high-resolution processing.
_src/transformers/models/granite4\vision · high confidence
Add Granite Speech 5.0 model support
Introduces the Granite Speech 5.0 model family, including the \GraniteSpeech5ForCTC\ architecture, \GraniteSpeech5EncoderConfig\, and \GraniteSpeech5CTCConfig\. Adds a dedicated \GraniteSpeech5FeatureExtractor\ for audio preprocessing and a \GraniteSpeech5Processor\ to handle audio-text tokenization. Includes a conversion script (\convert\_granite\_speech5\_to\_hf.py\) to migrate original IBM checkpoints into the native Hugging Face format, handling weight mapping and tokenizer alignment.
_src/transformers/models/granite\_speech5, src/transformers/models/unispeech\sat · high confidence
Add Granite Speech Plus model with multi-layer encoder feature concatenation
Introduces the Granite Speech Plus model, a variant of Granite Speech that enhances audio feature extraction by concatenating the encoder's final hidden states with outputs from arbitrary intermediate conformer layers (controlled by the new \cat\_hidden\_layers\ config option). This change adds the \granite\_speech\_plus\ module, including \GraniteSpeechPlusConfig\, \GraniteSpeechPlusEncoderConfig\, and the corresponding model implementations (\GraniteSpeechPlusModel\, \GraniteSpeechPlusCTCEncoder\, \GraniteSpeechPlusForConditionalGeneration\), enabling users to load and run this specific multimodal architecture.
_src/transformers/models/granite\_speech\plus · high confidence
Add Granite-SWA model with sliding window attention and learnable sinks
Introduces the Granite-SWA model, an extension of the Granite architecture that supports per-layer sliding window attention and a learnable per-head attention sink. The model configuration allows users to define \layer\_types\ to mix full and sliding attention (defaulting to full attention every fourth layer) and \sliding\_window\ size. The implementation includes a new \GraniteSWAConfig\, \GraniteSWAAttention\ module, and full model classes (\GraniteSWAModel\, \GraniteForCausalLM\) that apply a learnable sink parameter to rescale attention outputs, improving stability and performance for long-context sequences.
_src/transformers/models/granite\swa · high confidence
Add GraniteSWA and GraniteMoeSWA model support
Introduces two new model architectures: GraniteSWA and GraniteMoeSWA. These models extend the base Granite and GraniteMoeShared designs by adding per-layer sliding-window attention (configurable via \layer\_types\ and \sliding\_window\) and a learnable per-head attention sink that rescales attention output. The implementation includes configuration classes (\GraniteSWAConfig\, \GraniteMoeSWAConfig\), modular definitions, and auto-generated modeling files, supporting both eager and kernelized attention backends (FlashAttention-3/4, FlexAttention) with specific tensor-parallel and expert-parallel sharding plans.
_src/transformers/models/granitemoe\swa · high confidence
Add GreedyLR adaptive learning rate scheduler example
Users can now explore the GreedyLR adaptive learning rate scheduler through a new example in the \examples/scheduler\ directory. This includes a \run\_greedy.py\ script that demonstrates pre-training and fine-tuning causal language models (such as LLaMA 3.2 1B) using the \greedy\ scheduler type, alongside a \README.md\ that explains the scheduler's logic, parameters, and usage with both the Hugging Face Trainer API and standalone PyTorch optimizers.
examples/scheduler · high confidence
Add HGNetV2 backbone model support
Introduces the HGNetV2 model, a backbone architecture originally from PaddleDetection, to the Transformers library. Users can now load and use HGNetV2 for feature extraction and image classification tasks via the standard \AutoModel\ and \AutoModelForImageClassification\ interfaces, with configuration and model files automatically generated from the modular definition.
_src/transformers/models/hgnet\v2 · high confidence
Add HunYuan HYV3 model support
Adds the HunYuan HYV3 model, a large language model featuring a Mixture-of-Experts (MoE) architecture with 192 local experts and 1 shared expert. The implementation includes a custom Top-K router that applies a configurable scaling factor to expert selection weights, supports tensor parallelism and expert parallelism plans, and utilizes Rotary Position Embeddings for sequence modeling. Users can now load and run the \tencent/Hy3-preview\ checkpoint using the \HYV3Config\ and \HYV3Model\ classes.
_src/transformers/models/hy\v3 · high confidence
Add HunYuanDenseV1 model support
Users can now load and run the Tencent HunYuanDenseV1 model using the Hugging Face Transformers library. This new model type, \hunyuan\_v1\_dense\, is implemented as a modular extension of the Llama architecture, featuring specific configuration options (such as \rope\_parameters\ for dynamic NTK scaling) and custom attention layers that apply RMSNorm to query and key states before attention computation.
_src/transformers/models/hunyuan\_v1\dense · high confidence
Add HunYuanMoEV1 Mixture-of-Experts model
Introduces the HunYuanMoEV1 model, a Mixture-of-Experts (MoE) architecture supporting configurable top-k expert routing and dynamic RoPE parameters. The implementation includes a dedicated configuration class (\HunYuanMoEV1Config\) with validation for RoPE settings, modular components for attention with query/key layer normalization, MoE gating, and expert dispatch, and full support for distributed training strategies including FSDP and tensor parallelism via grouped GEMM plans.
_src/transformers/models/hunyuan\_v1\moe · high confidence
Add HunYuanVL multimodal vision-language model
Introduces the HunYuanVL model, a dense-only, image-text-to-text architecture supporting multimodal RoPE (mRoPE) for spatial and temporal positioning. The addition includes the core modeling components (vision tower, text backbone, and attention layers), configuration classes for both vision and text backbones with legacy field normalization, image processors (Torchvision and PIL backends) that handle dynamic smart-resizing and patchification, and a dedicated processor that expands image placeholders in prompts into the correct token spans for generation.
_src/transformers/models/hunyuan\vl · high confidence
Add HyperCLOVAX SEED Think 14B model support
Users can now load and run the HyperCLOVAX SEED Think 14B model (checkpoint: naver-hyperclovax/HyperCLOVAX-SEED-Think-14B) via the \hyperclovax\ model type. This new architecture extends the Granite design with Maximal Update Parametrization (MuP) scaling factors (embedding, logits, residual, and attention multipliers) and optional Peri-Layer Normalization (post-norm RMSNorm layers) controlled by the \use\_post\norm\ config flag. The implementation includes the modular definition, auto-generated configuration and modeling files, and the necessary \\\init\\_\ exports to make the model available in the library.
src/transformers/models/hyperclovax · high confidence
Add I-BERT model support
Adds the I-BERT model to the library, enabling users to load and run the I-BERT architecture which supports post-training quantization. The implementation includes a new \IBertConfig\ configuration class, the \IBertModel\ PyTorch model, and custom quantized modules (such as \QuantEmbedding\, \QuantLinear\, \IntLayerNorm\, and \IntSoftmax\) that allow the model to operate in quantized mode for reduced memory and compute usage while maintaining compatibility with standard Hugging Face Transformers interfaces.
src/transformers/models/ibert · high confidence
Add I-JEPA vision model support
Users can now load and run the I-JEPA (Image Joint Embedding Predictive Architecture) model for self-supervised vision tasks. This change introduces the \IJepaModel\ and \IJepaForImageClassification\ classes, along with the \IJepaConfig\ configuration class and a dedicated image processor (\ViTImageProcessor\). A conversion script is provided to migrate checkpoints from the original Facebook Research repository to the Hugging Face format, enabling immediate use of pre-trained I-JEPA weights for feature extraction and image classification.
src/transformers/models/ijepa · high confidence
Add IDEFICS multimodal model support
This change introduces the IDEFICS (Improving Language Understanding by Generative Pre-Training) model to the library, enabling users to load and run this vision-language model for tasks like image-text understanding and generation. The implementation includes the core \IdeficsModel\ and \IdeficsForCausalLM\ classes, a dedicated \IdeficsProcessor\ for handling mixed image and text inputs, and specific image processors (\IdeficsImageProcessor\ and \IdeficsImageProcessorPil\) for preprocessing visual data. It also provides configuration classes (\IdeficsConfig\, \IdeficsVisionConfig\, \IdeficsPerceiverConfig\) and components like the \IdeficsPerceiverResampler\ for compressing visual embeddings, allowing seamless integration into existing Hugging Face workflows.
(repo-wide) · high confidence
Add Jina-Embeddings-V3 and NomicBert models
Users can now load and run the Jina-Embeddings-V3 and NomicBert embedding models via the Hugging Face Transformers library. The Jina-Embeddings-V3 implementation provides a 1024-dimensional embedding model with 24 layers, supporting rotary position embeddings and bidirectional attention for tasks like semantic search. The NomicBert model, based on the Nomic-Embed-Text architecture, offers a 768-dimensional embedding model with 12 layers, also utilizing rotary position embeddings and bidirectional attention. Both models are configured with specific vocabulary sizes, hidden dimensions, and attention heads as defined in their respective configuration classes.
_src/transformers/models/jina\_embeddings\v3 · high confidence
Add Kimi K2.5 multimodal model support
Users can now load and run the Kimi K2.5 vision-language model via \AutoModelForCausalLM\ and \AutoProcessor\. This location provides the model implementation (including vision encoder, axial RoPE, and temporal embeddings), configuration, image and video processors, and the main processor, enabling multimodal inference with images and videos.
_src/transformers/models/kimi\k25 · high confidence
Add Kosmos-2 multimodal model support
Users can now load and run the Kosmos-2 model for image-text-to-text tasks. This change introduces the model architecture, configuration, and processor classes, along with a script to convert original Microsoft Research checkpoints to the Hugging Face format. The implementation supports standard generation and inference workflows for this specific multimodal capability.
src/transformers/models/kosmos2 · high confidence
Add LiLT model for layout-aware document understanding
Introduces the LiLT (Layout-aware Information Layout Transformer) model, enabling users to process documents by combining text content with spatial layout information (bounding box coordinates). The implementation includes \LiltConfig\ for configuration, \LiltTextEmbeddings\ for standard token embeddings, and \LiltLayoutEmbeddings\ to encode 2D positional data (left, upper, right, lower, height, width) into the model's hidden states. This allows the model to leverage structural layout cues alongside semantic text features for tasks like document information extraction.
src/transformers/models/lilt · high confidence
Add LightOnOCR multimodal model support
Users can now load and run the LightOnOCR model (LightOnOcrForConditionalGeneration) via the Hugging Face Transformers library. This new architecture combines a Pixtral-based vision encoder with a Qwen3 language model to process images and text together, featuring a custom processor for handling image tokenization and a configuration system that automatically manages sub-configs for the vision and text components.
_src/transformers/models/lighton\ocr · high confidence
Add M2M100 multilingual model support
Introduces the M2M100 model for multilingual translation, including the PyTorch implementation, configuration, tokenizer, and a script to convert original Fairseq checkpoints to Hugging Face format.
_src/transformers/models/m2m\100 · high confidence
Add MGP-STR model for scene text recognition
Introduces the MGP-STR (Multi-Granularity Prediction for Scene Text Recognition) model, including its configuration, PyTorch implementation, processor, and tokenizer. The model supports multi-head classification (character, BPE, and wordpiece) and uses a Vision Transformer backbone with distillation and A3 attention options. The processor handles image preprocessing and tokenization for three different tokenizer backends (character, BPE via GPT-2, and wordpiece via BERT), fusing their outputs to produce final text recognition results.
_src/transformers/models/mgp\str · high confidence
Add MPT (MosaicML Pretrained Text) model support
Users can now load and run MPT models from the Hugging Face Hub using the standard Transformers API. This change introduces the MptConfig, MptModel, and associated attention and MLP components, including support for Alibi positional embeddings, multi-head and multi-query attention variants, and gradient checkpointing for efficient training.
src/transformers/models/mpt · high confidence
Add Mimi audio codec model
Introduces the Mimi model, an audio codec supporting streaming and causal convolution, including its configuration, PyTorch implementation, and a checkpoint conversion script for loading pretrained weights.
src/transformers/models/mimi · high confidence
Add MiniCPM-V 4.7 multimodal model support
Users can now load and run the MiniCPM-V 4.7 model (checkpoint: openbmb/MiniCPM-V-4.7-1B) via the standard Hugging Face Transformers API. This new multimodal architecture supports complex image and video inputs, including variable-resolution images and video frames with detail slices, using a vision encoder and a text backbone (Qwen3.5-Text). The implementation includes a dedicated processor for handling image/video tokenization and a model class that manages visual groupings and canvas-based positional embeddings for accurate multimodal alignment.
_src/transformers/models/minicpmv4\_6, src/transformers/models/minicpmv4\7 · high confidence
Add Ministral 3 model support
Adds the Ministral 3 model family, including the \Ministral3Config\, \Ministral3ForCausalLM\, and related task-specific heads (sequence classification, token classification, question answering). The implementation introduces a custom \Ministral3Attention\ module that extends Mistral's attention with a specific scaling factor derived from \llama\_4\_scaling\_beta\ in the RoPE parameters, and includes a conversion script to migrate weights from the original Mistral format to Hugging Face Transformers, supporting both text-only and vision-language variants with FP8 quantization.
src/transformers/models/ministral3 · high confidence
Add Mistral 4 model support
Introduces the Mistral 4 architecture, including its configuration, modular and concrete modeling implementations, and a weight conversion script. The model features a Mixture-of-Experts (MoE) design with 128 routed experts, Multi-Latent Attention (MLA) with compressed KV latents, and support for interleaved RoPE embeddings. It also includes FP8-aware weight conversion utilities and distributed training plans (TP, PP, EP).
src/transformers/models/mistral4 · high confidence
Add Mixtral MoE model support
Adds the Mixtral model, a Mixture-of-Experts (MoE) language model, to the library. This includes the configuration class (\MixtralConfig\), the core modeling implementation (\modeling\_mixtral.py\ and \modular\_mixtral.py\), a weight conversion script for migrating original checkpoints, and the module initialization. The implementation supports the model's sparse MoE architecture with top-k routing, load balancing loss, and standard causal LM capabilities.
src/transformers/models/mixtral · high confidence
Add MobileNetV1 model support
Introduces a new MobileNetV1 model for image classification, including the model implementation, configuration, and image processors (both PIL and Torchvision backends). A conversion script is also provided to load pre-trained TensorFlow checkpoints into the PyTorch model.
_src/transformers/models/mobilenet\v1 · high confidence
Add MobileNetV2 model support
Introduces the MobileNetV2 architecture for image classification and semantic segmentation, including the model implementation, configuration, and image processors (with both Torchvision and PIL backends). A script is also provided to convert original TensorFlow checkpoints to PyTorch.
_src/transformers/models/mobilenet\v2 · high confidence
Add ModernBERT model support
ModernBERT is now available in the Transformers library, providing a new architecture optimized for efficiency and performance. Users can load pre-trained ModernBERT models for tasks such as masked language modeling, sequence classification, token classification, multiple choice, and question answering. The model supports features like local sliding-window attention, configurable rotary position embeddings (RoPE) with different parameters for full and sliding attention layers, and deterministic flash attention. Configuration options allow tuning of normalization, dropout, and pooling strategies, while the implementation includes support for gradient checkpointing and efficient weight initialization.
(repo-wide) · high confidence
Add Moonshine Streaming model for audio processing
Introduces the Moonshine Streaming model, a new encoder-decoder architecture designed for streaming audio tasks. This addition includes the model implementation, configuration classes (MoonshineStreamingConfig and MoonshineStreamingEncoderConfig), and a dedicated processor (MoonshineStreamingProcessor) for handling audio and text inputs. The model supports sliding window configurations for encoder layers and utilizes rotary embeddings, enabling efficient processing of audio streams with features like causal convolution and frame-level CMVN normalization.
_src/transformers/models/moonshine\streaming · high confidence
Add Multi Resolution Analysis (MRA) model support
Users can now load and run the Multi Resolution Analysis (MRA) model, a transformer architecture designed for efficient attention mechanisms. This change introduces the \MraConfig\ and \MraModel\ classes, along with task-specific heads like \MraForMaskedLM\. The implementation includes a checkpoint converter to migrate weights from the original MRA repository and supports optional CUDA kernel acceleration for performance improvements on compatible hardware.
src/transformers/models/mra · high confidence
Add MuseGlimmer multimodal model support
Introduces the MuseGlimmer model, a multimodal architecture capable of processing both images and video alongside text. This change adds the core model implementation, configuration classes for the vision and text components, and dedicated processors for image and video preprocessing. It also includes a weight conversion script to load original MuseGlimmer checkpoints into the Hugging Face format, along with the necessary module initialization files to make the model accessible via the library's auto-classes.
_src/transformers/models/muse\glimmer · high confidence
Add Music Flamingo multimodal model
Introduces the Music Flamingo model, a multimodal architecture combining an AudioFlamingo3 audio encoder with a Qwen2 language model for music and audio understanding tasks. This release includes the model configuration, modular and standard PyTorch implementations, a dedicated processor for handling audio-text inputs, and conversion scripts to migrate both original Music Flamingo and AudioFlamingoNext checkpoints into the Hugging Face format.
src/transformers/models/musicflamingo · high confidence
Add MusicGen text-to-music model
Introduces the MusicGen model, enabling text-to-music generation. This change adds the core implementation files including the model architecture (MusicgenForConditionalGeneration and MusicgenForCausalLM), configuration classes (MusicgenConfig, MusicgenDecoderConfig), and a processor (MusicgenProcessor) for handling text and audio inputs. It also includes a conversion script to load checkpoints from the original Meta AI repository into the Hugging Face Transformers format.
src/transformers/models/musicgen · high confidence
Add Musicgen Melody model for text- and audio-conditioned music generation
Introduces the Musicgen Melody model, a new capability for generating music conditioned on text prompts and/or reference audio. This release adds the model implementation, configuration, feature extractor, processor, and a checkpoint conversion script, enabling users to load and run the model via standard Hugging Face Transformers APIs.
_src/transformers/models/musicgen\melody · high confidence
Add MyT5 model support with tokenizer and TensorFlow checkpoint conversion
Users can now use the MyT5 model architecture via the Hugging Face Transformers library. This change introduces the \MyT5Tokenizer\ class, which implements byte-level tokenization with a configurable hash-tree-based byte rewriter and support for extra sentinel tokens. It also provides a \\_\init\\_.py\ module for lazy loading and a conversion script (\convert\_myt5\_original\_tf\_checkpoint\_to\_pytorch.py\) that allows users to load pre-trained MyT5 checkpoints originally saved in TensorFlow format into PyTorch.
src/transformers/models/myt5 · high confidence
Add NVIDIA Canary-1B-v2 and Qwen3 ASR model support
Users can now load and run the NVIDIA Canary-1B-v2 and Qwen3 ASR (including Forced Aligner) models directly from the Hugging Face Hub. This adds new model classes, configurations, and processors for Canary (an encoder-decoder architecture with a Parakeet encoder and Transformer decoder) and Qwen3 ASR (a multimodal model with a Qwen3 text decoder and audio encoder). The release includes conversion scripts to migrate existing NeMo (for Canary) and original Qwen3 checkpoints to the Hugging Face Transformers format, enabling seamless integration of these specific audio and speech-to-text models into existing workflows.
_src/transformers/models/canary, src/transformers/models/qwen3\asr · high confidence
Add NVIDIA Megatron BERT model support
Users can now load and run NVIDIA Megatron BERT models using the Hugging Face Transformers library. This change introduces the MegatronBertConfig, MegatronBertModel, and associated heads (masked LM, sequence classification, question answering, etc.), along with a conversion script to migrate checkpoints from the original NVIDIA Megatron-LM format into the Hugging Face format.
_src/transformers/models/megatron\bert · high confidence
Add Nemotron 3.5 ASR streaming model support
Users can now load and run the NVIDIA Nemotron 3.5 ASR streaming model (e.g., nvidia/nemotron-3.5-asr-streaming-0.6b) via the new \Nemotron3\_5Asr\ classes. This multilingual, prompt-conditioned streaming RNN-T model supports cache-aware inference for low-latency audio processing and includes a built-in converter script to migrate NeMo checkpoints to the Hugging Face format.
_src/transformers/models/nemotron3\_5\asr · high confidence
Add Nemotron3Diarization model for speaker diarization
Introduces the Nemotron3Diarization model, a new capability for speaker diarization that supports both offline and streaming inference. The package includes the model implementation, configuration classes (audio, head, and streaming), a processor for handling audio chunks and streaming modes (low, very low, and ultra-low latency), and a conversion script to import NVIDIA NeMo checkpoints into the Hugging Face format.
_src/transformers/models/nemotron3\diarization · high confidence
Add NeoMME and NeoMME-Retriever model support
Introduces the NeoMME model architecture and its associated components, including the \NeoMMEConfig\, \NeoMMEImageProcessor\, \NeoMMEProcessor\, and \NeoMMEModel\. This addition enables users to load and run NeoMME models, which feature a hybrid attention mechanism with full and sliding window layers, factorized token embeddings, and two-axis interleaved M-RoPE for handling both text and image inputs in a retrieval-ready format.
src/transformers/models/neomme · high confidence
Add NeuCodec neural audio codec model
Introduces the NeuCodec model, a neural audio codec that encodes audio into discrete codes and decodes them back to waveforms. This includes the model implementation, configuration, feature extraction, and a checkpoint conversion script to load weights from the original neuphonic/neucodec repository.
src/transformers/models/neucodec · high confidence
Add Nougat model for scientific PDF-to-Markdown conversion
Introduces the Nougat model, a vision-encoder-decoder architecture designed to convert scientific PDFs into Markdown. This change adds the core implementation files including NougatConfig (utilizing DonutSwin for the encoder and MBart for the decoder), NougatProcessor, NougatTokenizerFast, and image processors (supporting both Torchvision and PIL backends). It also includes a conversion script to migrate checkpoints from the original Facebook Research Nougat library to the Hugging Face format.
src/transformers/models/nougat · high confidence
Add OLMo model family support
Users can now load and run EleutherAI's OLMo models using the Hugging Face Transformers library. This change introduces the \OlmoConfig\, \OlmoModel\, \OlmoForCausalLM\, and \OlmoForSequenceClassification\ classes, along with a weight conversion script to migrate OLMo checkpoints to the Hugging Face format. The implementation leverages the modular model architecture, inheriting from Llama-based components while applying OLMo-specific adjustments such as QKV clipping and a distinct LayerNorm implementation.
src/transformers/models/olmo · high confidence
Add OWLv2 model support for open-vocabulary object detection
The OWLv2 model is now available in the library, enabling open-vocabulary object detection and image-text contrastive learning. This release includes the core PyTorch implementation (\Owlv2ForObjectDetection\, \Owlv2VisionModel\, \Owlv2TextModel\), configuration classes (\Owlv2Config\), and processors (\Owlv2Processor\, \Owlv2ImageProcessor\) for handling image and text inputs. A conversion script is provided to load checkpoints from the original Google Research repository, and the image processor supports both Torchvision and PIL backends with specific padding and scaling logic for OWLv2's patch-based architecture.
src/transformers/models/owlv2 · high confidence
Add OmDet-Turbo object detection model
Introduces the OmDet-Turbo model for object detection, including the \OmDetTurboConfig\, \OmDetTurboForObjectDetection\ model class, and \OmDetTurboProcessor\. The model supports a Swin Transformer or timm-based vision backbone and a CLIP text encoder, enabling detection guided by natural language task descriptions. A conversion script is provided to load checkpoints from the original OmDet repository, and the implementation includes support for custom kernels and efficient attention mechanisms.
(repo-wide) · high confidence
Add OneFormer model for universal segmentation
Introduces the OneFormer model, a unified architecture capable of performing semantic, instance, and panoptic segmentation in a single pass. This addition includes the model implementation, configuration, image processors (with both PyTorch and PIL backends), a processor for handling image and text task inputs, and a conversion script to load checkpoints from the original SHI Labs repository.
src/transformers/models/oneformer · high confidence
Add OpenAI GPT model support
The library now includes the OpenAI GPT model, providing users with the \OpenAIGPTConfig\, \OpenAIGPTModel\, and \OpenAIGPTTokenizer\ classes. This addition enables the use of the OpenAI GPT architecture for causal language modeling and sequence classification tasks, along with a tokenizer based on Byte-Pair Encoding. A conversion script is also provided to load original TensorFlow checkpoints into PyTorch.
src/transformers/models/openai · high confidence
Add Ovis2 multimodal model and processor
Users can now load and run the Ovis2 vision-language model using the standard Hugging Face Transformers API. This change introduces the \Ovis2ForConditionalGeneration\ model class, along with \Ovis2Config\, \Ovis2Processor\, and dedicated image processors (\Ovis2ImageProcessor\ and \Ovis2ImageProcessorPil\) to handle multimodal inputs. A weight conversion script is also provided to migrate existing Ovis2 checkpoints to the Hugging Face format, enabling immediate use of pre-trained models for image-text tasks.
src/transformers/models/ovis2 · high confidence
Add PEGASUS-X encoder-decoder model support
Introduces the PEGASUS-X model, a new encoder-decoder architecture for sequence-to-sequence tasks. The implementation includes \PegasusXConfig\ for model configuration (supporting options like block size and global tokens), \PegasusXModel\ for the core neural network, and integration with the library's generation and caching utilities. This adds a new capability for users to load, fine-tune, and generate text with the PEGASUS-X architecture.
_src/transformers/models/pegasus\x · high confidence
Add PI0 model for robot action prediction
Introduces the PI0 model, a vision-language-action architecture combining a PaliGemma visual backbone with a DiT action expert to predict robotic actions via flow matching. This release adds the \PI0Config\, \PI0ImageProcessor\, \PI0Processor\, and \PI0Model\ classes to \src/transformers/models/pi0\, enabling users to load, process, and run inference on the \lerobot/pi0\_base\ checkpoint for robotics tasks.
src/transformers/models/pi0 · high confidence
Add PLBART model support for code translation
Introduces the PLBART (Polymorphic Language BART) model, a sequence-to-sequence architecture designed for code-to-text, text-to-code, and code-to-code translation tasks. This change adds the \PLBartConfig\, \PLBartModel\, \PLBartForConditionalGeneration\, and \PLBartTokenizer\ classes, along with a script to convert original Fairseq checkpoints to Hugging Face format. The tokenizer supports multiple programming languages (Java, Python, JavaScript, PHP, Ruby, Go) and natural languages (English) via language-specific tokens, enabling polymorphic processing of mixed code and text inputs.
src/transformers/models/plbart · high confidence
Add PP-DocLayoutV2 model support
Users can now load and run the PP-DocLayoutV2 model for document layout analysis and reading order prediction. This release adds the model configuration, image processor, and PyTorch implementation to the library, allowing integration with the standard Hugging Face Transformers API for object detection and layout understanding tasks.
_src/transformers/models/pp\_doclayout\v2 · high confidence
Add PP-DocLayoutV3 model support
Users can now load and run the PP-DocLayoutV3 document layout model via the Hugging Face Transformers library. This change introduces the \PPDocLayoutV3Config\, \PPDocLayoutV3ImageProcessor\, and \PPDocLayoutV3ForObjectDetection\ model class, enabling document layout analysis tasks with a configuration that supports features like multi-scale feature encoding, denoising training, and custom global pointer heads.
_src/transformers/models/pp\_doclayout\v3 · high confidence
Add PP-LCNetV3 model support
Users can now load and use the PP-LCNetV3 architecture (model type pp\_lcnet\_v3) via the Hugging Face Transformers library. This new model, originating from the PaddlePaddle ecosystem, features a configurable multi-stage backbone with learnable reparameterization layers and squeeze-and-excitation blocks. The implementation includes the configuration class (PPLCNetV3Config), the PyTorch model definition (PPLCNetV3PreTrainedModel), and the necessary module exports, allowing integration into pipelines requiring this specific lightweight vision architecture.
_src/transformers/models/pp\_lcnet\v3 · high confidence
Add PP-LCNetV4 model support
Users can now load and run the PP-LCNetV4 architecture (model type \pp\_lcnet\_v4\) via the Hugging Face Transformers library. This new model, part of the PP-OCRv6 series, features a configurable stem (large or small), learnable affine blocks, and squeeze-and-excitation modules, with default configurations optimized for PP-LCNetV3-style stages.
_src/transformers/models/pp\_lcnet\v4 · high confidence
Add PP-OCRv5 server-side text recognition model
Users can now load and run the PP-OCRv5\_server\_rec model for text recognition tasks. This change introduces the model architecture, configuration, and an image processor that groups images by shape to optimize batched resizing and padding.
_src/transformers/models/pp\_ocrv5\_server\rec · high confidence
Add PP-OCRv6 Medium and Small Detection Models
Introduces two new object detection models, \PPOCRV6MediumDet\ and \PPOCRV6SmallDet\, designed for text detection tasks. These models are available via the \PPOCRV6MediumDetConfig\ and \PPOCRV6SmallDetConfig\ classes and are pre-trained on the \PaddlePaddle/PP-OCRv6\_medium\_det\_safetensors\ and \PaddlePaddle/PP-OCRv6\_small\_det\_safetensors\ checkpoints respectively. The implementation includes specialized components such as the \PPOCRV6MediumDetNeck\ with configurable interpolation modes and the \PPOCRV6SmallDetDepthwiseSeparableConvLayer\ featuring squeeze-excitation modules, enabling users to leverage these architectures for detecting text regions in images.
_src/transformers/models/pp\_ocrv6\_medium\_det, src/transformers/models/pp\_ocrv6\_small\det · high confidence
Add PP-OCRv6 Small and Tiny text-recognition models
This change introduces the PP-OCRv6 Small and Tiny models for text recognition, providing the configuration, image processing, and PyTorch modeling files for both variants. The PP-OCRv6 Small model includes a custom image processor that groups images by shape for efficient batched resizing, converts RGB to BGR, and uses antialias=False to align with cv2.resize behavior. The PP-OCRv6 Tiny model is a lighter variant that reuses the Small model's backbone and head structure but with a smaller output vocabulary (6625 vs 18714 characters). Both models are registered in the transformers library and can be loaded using AutoModelForTextRecognition.
_src/transformers/models/pp\_ocrv6\_small\rec · high confidence
Add PVT (Pyramid Vision Transformer) model support
Users can now load and run the PVT model for image classification tasks. This change introduces the model architecture, configuration, and image processing pipeline, along with a converter script to migrate checkpoints from the original PVT implementation to Hugging Face Transformers.
src/transformers/models/pvt · high confidence
Add Parakeet speech recognition models
Introduces the Parakeet model family for automatic speech recognition, including a base encoder, CTC (Connectionist Temporal Classification), RNNT (Recurrent Neural Network Transducer), and TDT (Token-and-Duration Transducer) variants. This addition includes the model implementations, configuration classes, feature extraction, tokenization, and processing utilities, along with a converter script to migrate weights from NVIDIA NeMo checkpoints to the Hugging Face format.
src/transformers/models/parakeet · high confidence
Add PatchTST model for time series forecasting
Introduces the PatchTST model, a new architecture for time series forecasting that segments input sequences into patches to capture local patterns. The implementation includes \PatchTSTConfig\ for configuring parameters such as patch length, stride, and attention heads, and \PatchTSTModel\ which supports various attention implementations (including SDPA) and probabilistic prediction heads (Student-t, Normal, Negative Binomial). This adds a new capability for users to leverage patch-based Transformer models for regression and classification tasks on temporal data.
src/transformers/models/informer, src/transformers/models/patchtst, src/transformers/models/timesfm · high confidence
Add PeAudio model for audio-text contrastive learning
Introduces the PeAudio model, a new architecture for aligning audio and text representations. This change adds the \PeAudio\ and \PeAudioEncoder\ models, along with their corresponding \PeAudioConfig\, \PeAudioFeatureExtractor\, and \PeAudioProcessor\ classes. The audio encoder utilizes a DAC-based encoder to tokenize raw audio, which is then processed by a transformer encoder with rotary embeddings. The model supports contrastive learning between audio and text embeddings, enabling tasks such as audio-text retrieval.
_src/transformers/models/pe\audio · high confidence
Add PeVideo model for video-text contrastive learning
Introduces the PeVideo model, a multimodal architecture that combines a text encoder (ModernBERT) with a video encoder (ViT) to perform contrastive learning between video and text representations. The package includes configuration classes (PeVideoConfig, PeVideoEncoderConfig), the model implementation (PeVideoModel, PeVideoEncoder), and processors (PeVideoProcessor, PeVideoVideoProcessor) to handle video frame sampling and padding. Users can now load and run this specific video-text alignment model using the standard Hugging Face Transformers API.
_src/transformers/models/pe\video · high confidence
Add PerceptionLM multimodal model support
Introduces the PerceptionLM model, a multimodal architecture supporting image and video inputs alongside text. This change adds the model implementation (including vision tower, multimodal projector, and language model integration), configuration, image and video processors, and a unified processor for tokenization and input preparation. It also includes a weight conversion script to load Meta's Perception-LM checkpoints into the Hugging Face Transformers format, enabling users to utilize this model for vision-language tasks.
_src/transformers/models/perception\lm · high confidence
Add Phi-4 Multimodal model support
Introduces the Phi-4 Multimodal model, a new multimodal capability that processes text, images, and audio. This change adds the model implementation, configuration classes (Phi4MultimodalConfig, Phi4MultimodalVisionConfig, Phi4MultimodalAudioConfig), a dedicated processor for handling mixed inputs, image and audio feature extractors, and a weight conversion script to load Microsoft's original checkpoints into the Hugging Face format.
_src/transformers/models/phi4\multimodal · high confidence
Add Phi-MoE model support
Introduces the Phi-MoE model, a Mixture-of-Experts (MoE) variant of the Phi architecture. This adds \PhimoeConfig\ and \PhimoeModel\ classes, enabling users to load and run the Microsoft Phi-3.5-MoE model. The implementation includes specific MoE routing logic (sparse mixer), RoPE embeddings, and attention mechanisms, with configuration options for expert counts, jitter noise, and sliding window attention.
src/transformers/models/phimoe · high confidence
Add Pixio pre-trained vision transformer models
Users can now load and use Meta's Pixio vision transformer models (e.g., \facebook/pixio-huge\) via the Hugging Face Transformers library. This change introduces the \PixioConfig\, \PixioModel\, and \PixioPreTrainedModel\ classes, along with a \BitImageProcessor\ for input handling and a conversion script (\convert\_pixio\_to\_pytorch.py\) to migrate checkpoints from the original Facebook repository. The models support backbone usage with configurable layer normalization and hidden state reshaping, and include support for multiple model sizes (ViT-B, ViT-L, ViT-H, ViT-1B, ViT-5B).
src/transformers/models/pixio · high confidence
Add PocketTTS model support
Adds support for the PocketTTS text-to-speech model, including configuration, feature extraction, processing, and generation logic. Users can now load and run PocketTTS checkpoints (e.g., from kyutai/pocket-tts) via the standard transformers API, with automatic conversion scripts provided to map original weights to the Hugging Face format. The implementation includes a custom flow head for audio latent generation, an audio tokenizer (Mimi-based) for voice prompts, and a specialized generation mixin that handles end-of-speech detection and frame budgeting based on text length.
_src/transformers/models/pocket\tts · high confidence
Add Pop2Piano model for audio-to-MIDI generation
Introduces the Pop2Piano model, a sequence-to-sequence transformer that converts audio recordings into MIDI notation. This addition includes the full model implementation (\Pop2PianoForConditionalGeneration\), a configuration class (\Pop2PianoConfig\), a feature extractor for processing audio into mel-spectrograms and beat steps, a tokenizer for MIDI tokenization, and a processor to orchestrate the pipeline. A weight conversion script is also provided to load the original checkpoint from the \sweetcocoa/pop2piano\ repository into the Hugging Face format.
src/transformers/models/pop2piano · high confidence
Add PvtV2 model support
Users can now load and run the PvtV2 (PyTorch Vision Transformer v2) architecture for image classification and feature extraction. This change introduces the model implementation, its configuration class, and a conversion script to migrate checkpoints from the original library, enabling direct usage of PvtV2 models via the standard Hugging Face Transformers API.
_src/transformers/models/pvt\v2 · high confidence
Add PyTorch ELECTRA model support
Users can now load and run the ELECTRA architecture in PyTorch. This change introduces the \ElectraConfig\ configuration class, the core \ElectraModel\ and related PyTorch modeling classes (such as \ElectraForMaskedLM\ and \ElectraForPreTraining\), and a conversion script to migrate original TensorFlow checkpoints to PyTorch. The implementation includes support for standard ELECTRA components like embeddings, self-attention, and generator/discriminator heads, enabling sequence classification, masked language modeling, and pre-training tasks.
src/transformers/models/electra · high confidence
Add Qwen2.5-VL and HyperCLOVAX Vision V2 model support
Users can now load and run the Qwen2.5-VL and HyperCLOVAX Vision V2 multimodal models directly from the Hugging Face Hub. This change introduces the full model implementations, including the \Qwen2\_5\_VLConfig\ and \HyperCLOVAXVisionV2Config\ classes, the corresponding \modeling\ modules for forward passes and feature extraction, and dedicated \processing\ modules to handle image and video tokenization. The Qwen2.5-VL implementation specifically supports axial RoPE for vision inputs and integrates with the standard Transformers generation pipeline.
_src/transformers/models/qwen2\_5\vl · high confidence
Add Qwen2Audio model support
Users can now load and run the Qwen2Audio multimodal model, which combines a Qwen2 text backbone with a Qwen2Audio encoder for audio understanding. This change introduces the \Qwen2AudioConfig\, \Qwen2AudioForConditionalGeneration\ model class, and \Qwen2AudioProcessor\ to handle audio-text inputs, including a chat template that supports interleaved audio and text content.
_src/transformers/models/qwen2\audio · high confidence
Add Qwen2MoE model support
Users can now load and run the Qwen2MoE architecture, a Mixture-of-Experts (MoE) language model. This change introduces the \Qwen2MoeConfig\ for model configuration, the \Qwen2MoeModel\ and \Qwen2MoeForCausalLM\ implementations for forward passes and generation, and the necessary modular components (attention, MoE blocks, RMSNorm, RoPE). The model supports features like sliding window attention, tensor parallelism plans, and expert dispatching.
_src/transformers/models/qwen2\moe · high confidence
Add Qwen3-VL and Cosmos3-Omni model support
Users can now load and run the Qwen3-VL and Cosmos3-Omni models. This adds the Qwen3-VL architecture (including its vision, text, and processor components) and the Cosmos3-Omni model, which reuses the Qwen3-VL backbone but drops generator, sound, and action tower weights when loading unified checkpoints. The Qwen3-VL video processor now supports an opt-in per-frame pixel cap to control token usage during video inference.
_src/transformers/models/qwen3\vl · high confidence
Add RF-DETR model support for object detection and instance segmentation
Users can now load and run Roboflow's RF-DETR models for object detection and instance segmentation using the Hugging Face Transformers library. This change introduces the \RfDetrModel\, \RfDetrForObjectDetection\, and \RfDetrForInstanceSegmentation\ classes, along with the \RfDetrImageProcessor\ for handling input preprocessing and annotation conversion. A weight conversion script is provided to migrate checkpoints from the original Roboflow repository to the Hugging Face Hub format, supporting various model sizes from nano to xxlarge.
_src/transformers/models/rf\detr · high confidence
Add RT-DETRv2 object detection model
Introduces the RT-DETRv2 model for object detection, including its configuration (\RTDetrV2Config\), modular definition, PyTorch implementation (\RTDetrV2ForObjectDetection\), and a weight conversion script to load checkpoints from the original Baidu/Timm implementation. The model supports multi-scale deformable attention with configurable sampling methods and integrates with the Hugging Face Transformers ecosystem via lazy loading and auto-mapping.
_src/transformers/models/rt\_detr\v2 · high confidence
Add RecurrentGemma model support
Introduces the RecurrentGemma model, a new architecture combining recurrent (LRU) and attention blocks. This change adds the model configuration, core modeling implementation, and a weight conversion script to load Google's RecurrentGemma checkpoints into the Hugging Face Transformers library.
_src/transformers/models/recurrent\gemma · high confidence
Add RoCBert model support
Users can now load and run the RoCBert model, a BERT-based architecture designed for Chinese text that incorporates pronunciation and shape embeddings. This change introduces the \RoCBertConfig\, \RoCBertModel\, and \RoCBertTokenizer\ classes, allowing access to the \weiweishi/roc-bert-base-zh\ checkpoint via the standard Hugging Face Transformers API.
_src/transformers/models/roc\bert · high confidence
Add RoFormer model with rotary position embeddings
Introduces the RoFormer model, which utilizes rotary position embeddings (RoPE) for sequence modeling. This addition includes the PyTorch implementation (\modeling\_roformer.py\), configuration (\configuration\_roformer.py\), and a fast tokenizer (\tokenization\_roformer.py\) that integrates Jieba pre-tokenization for Chinese text processing. A utility script is also provided to convert original TensorFlow checkpoints to PyTorch, and the model exports standard Hugging Face interfaces for masked language modeling, sequence classification, and question answering.
src/transformers/models/roformer · high confidence
Add SAM3 Tracker model for video object segmentation
Introduces the Sam3Tracker model, a new architecture for generating segmentation masks in video sequences using input points, boxes, or masks. This change adds the model implementation, configuration classes (Sam3TrackerConfig, Sam3TrackerPromptEncoderConfig, Sam3TrackerMaskDecoderConfig), and a dedicated processor (Sam3TrackerProcessor) to handle image preprocessing and coordinate normalization. The model is built upon the SAM2 architecture, extending it with tracking-specific components like memory attention and temporal positional encoding, and is available via the \facebook/sam3\ checkpoint.
_src/transformers/models/sam3\tracker · high confidence
Add SAM3-LiteText model support
Users can now load and run the SAM3-LiteText model, a lightweight variant of SAM3 optimized for text-guided segmentation. This change introduces the model implementation, configuration classes (including sub-configs for geometry, DETR, and text encoders), a checkpoint conversion script to migrate from the original EfficientSAM3 LiteText format, and the necessary module exports. The model leverages MobileCLIP-style RepMixer blocks for the text encoder and integrates with the existing SAM3 vision backbone.
_src/transformers/models/sam3\_lite\text · high confidence
Add SEW and SEW-D speech models
Introduces the SEW (Squeeze-and-Excitation Weights) and SEW-D (SEW with Downsampling) speech models, including the \SEWConfig\, \SEWModel\, \SEWForCTC\, and \SEWForSequenceClassification\ classes, along with a converter for original PyTorch checkpoints. This adds support for these specific architectures to the library's speech model suite.
src/transformers/models/sew · high confidence
Add SLANeXt model for table structure recognition
Users can now load and run the SLANeXt model, a multimodal architecture designed for table structure recognition. This change introduces the model configuration (SLANeXtConfig), a custom image processor (SLANeXtImageProcessor) that handles resizing and normalization for 512x512 inputs, and the core modeling components including a vision encoder and an attention-based GRU cell for decoding table structures. The model is available via the standard Hugging Face Transformers API.
src/transformers/models/slanext · high confidence
Add SLANet model for table recognition
SLANet is now available for table structure recognition tasks. The model uses a PP-LCNet backbone and an attention-based GRU cell to predict table structures autoregressively. Users can load the model via \AutoModel\ or \AutoModelForTableRecognition\ using the \slanet\ model type, with configuration options for hidden size, output channels, and maximum text length.
src/transformers/models/slanet · high confidence
Add Salesforce CTRL model support
Users can now load and run the Salesforce CTRL (Conditional Transformer Language Model) in PyTorch. This change introduces the \CTRLConfig\, \CTRLModel\, \CTRLForSequenceClassification\, and \CTRLTokenizer\ classes, enabling CTRL-based text generation and sequence classification tasks via the standard Hugging Face Transformers API.
src/transformers/models/ctrl · high confidence
Add Sapiens2 model for multi-task vision
Introduces the Sapiens2 model, a unified architecture supporting semantic segmentation, pose estimation, normal estimation, pointmap estimation, and image matting. This release adds the model configuration, image processor (including keypoint preprocessing and bounding-box cropping), and core modeling components to the transformers library.
src/transformers/models/sapiens2 · high confidence
Add SeamlessM4T model support
Introduces the SeamlessM4T model, a multilingual speech-to-text, text-to-speech, and speech-to-speech translation system. This addition includes the model architecture (\modeling\_seamless\_m4t.py\), configuration (\configuration\_seamless\_m4t.py\), feature extractor for audio processing, tokenizer for text, and a combined processor. A conversion script is also provided to migrate checkpoints from the original Meta SeamlessM4T implementation to the Hugging Face format.
_src/transformers/models/seamless\_m4t, src/transformers/models/seamless\_m4t\v2 · high confidence
Add SegFormer model for semantic segmentation and image classification
Introduces the SegFormer model, including its configuration, PyTorch implementation, and image processing pipeline. The model supports semantic segmentation (with label reduction for datasets like ADE20k) and image classification, featuring a Mix Transformer encoder with spatially reduced attention. A checkpoint conversion script is provided to load original NVIDIA/HuggingFace weights, and the image processor handles resizing, normalization, and segmentation map preprocessing.
src/transformers/models/segformer · high confidence
Add SegGPT model for image segmentation
Introduces the SegGPT model, a vision transformer-based architecture for image segmentation tasks. This release includes the core model implementation (SegGptForImageSegmentation), a dedicated configuration class (SegGptConfig) with strict validation, and image processors supporting both PIL and Torchvision backends to handle prompt images and masks. A checkpoint conversion script is also provided to migrate weights from the original BAAI repository, enabling users to load pre-trained SegGPT models directly from the Hugging Face Hub.
src/transformers/models/seggpt · high confidence
Add Segment Anything 2 (SAM2) model support
Introduces the Segment Anything 2 (SAM2) model to the library, including the \Sam2Model\ architecture, \Sam2Processor\ for handling images and prompt inputs (points/boxes), \Sam2ImageProcessor\ for preprocessing, and configuration classes (\Sam2Config\, \Sam2HieraDetConfig\, etc.). A checkpoint conversion script (\convert\_sam2\_to\_hf.py\) is provided to load weights from the original Meta AI repository, and the model is registered in the auto-modules for easy access via \AutoModel\ and \AutoProcessor\.
src/transformers/models/sam2 · high confidence
Add Splinter model for span-based question answering
Introduces the Splinter model, a PyTorch implementation for span-based question answering tasks. This change adds the model architecture (modeling\_splinter.py), configuration (configuration\_splinter.py), and tokenizer (tokenization\_splinter.py) to the library, making the model available via the standard Hugging Face Transformers API for inference and fine-tuning.
src/transformers/models/splinter · high confidence
Add Step-3.7-Flash multimodal model support
Introduces the Step-3.7-Flash model (StepFun) to the library, providing a complete multimodal pipeline including configuration, image processing, tokenization, and model architecture. The image processor implements a sliding-window strategy to split images into a global down-scaled view and local patch crops, adapting to aspect ratios. The text backbone features a Mixture-of-Experts (MoE) design with configurable layer types (sparse/dense), sliding attention, and multi-token prediction (MTP) support. The model also includes a vision tower with axial 2D rotary embeddings and exports router logits for MoE layers.
src/transformers/models/step3p7 · high confidence
Add Suno Bark text-to-speech model support
Introduces the Suno Bark model for text-to-speech generation, including the core \BarkModel\ with semantic, coarse, and fine acoustics sub-models, along with \BarkConfig\ and \BarkProcessor\ classes. The implementation supports Flash Attention 2, CPU offloading, and includes a converter script (\convert\_suno\_to\_hf.py\) to migrate Suno's original PyTorch checkpoints to the Hugging Face format.
src/transformers/models/bark · high confidence
Add SuperGlue keypoint matching model and image processors
Introduces the SuperGlue model for keypoint matching, including the \SuperGlueConfig\, \SuperGlueModel\, and \SuperGlueForKeypointMatching\ classes, along with dedicated image processors (\SuperGlueImageProcessor\ and \SuperGlueImageProcessorPil\) that handle image pair preprocessing, resizing, and grayscale conversion. A conversion script is also provided to migrate existing SuperGlue checkpoints to the Hugging Face format, enabling users to load and run keypoint matching inference using the standard Transformers API.
src/transformers/models/superglue · high confidence
Add SuperPoint keypoint detection model and image processors
Introduces the SuperPoint model for keypoint detection and description, including the \SuperPointForKeypointDetection\ model class, \SuperPointConfig\, and image processors (\SuperPointImageProcessor\ and \SuperPointImageProcessorPil\) that handle resizing, rescaling, and optional grayscale conversion. The model outputs keypoints, scores, and descriptors, with post-processing logic to convert relative coordinates to absolute image coordinates. A conversion script is also provided to migrate original SuperPoint checkpoints to the Hugging Face format.
src/transformers/models/superpoint · high confidence
Add SwiftFormer model for image classification
Introduces the SwiftFormer model, a vision architecture designed for efficient image classification. This change adds the model configuration, core PyTorch implementation, and a conversion script to load weights from the original implementation, enabling users to utilize SwiftFormer variants (XS, S, L1, L3) within the Hugging Face Transformers library.
src/transformers/models/swiftformer · high confidence
Add Swin Transformer V2 model support
Users can now load and run the Swin Transformer V2 (SwinV2) architecture for vision tasks. This change introduces the \Swinv2Config\, \Swinv2Model\, and associated output classes, along with a conversion script to import checkpoints from the \timm\ library. The implementation supports image classification and masked image modeling, enabling users to leverage SwinV2's shifted window attention mechanism within the Hugging Face Transformers ecosystem.
src/transformers/models/swinv2 · high confidence
Add T5Gemma encoder-decoder model
Introduces the T5Gemma model, a new encoder-decoder architecture combining T5 and Gemma capabilities. The implementation includes \T5GemmaConfig\ and \T5GemmaModuleConfig\ for managing encoder and decoder sub-configurations, along with \modeling\_t5gemma.py\ containing the core model classes, attention mechanisms (self-attention and cross-attention), and rotary embeddings. The model supports features like sliding window attention, flash attention, and various cache types, enabling text-to-text generation tasks with the T5Gemma checkpoint.
src/transformers/models/t5gemma · high confidence
Add TIPSv2-DPT model for dense prediction tasks
Introduces the TIPSv2-DPT model, a new architecture for dense prediction tasks including depth estimation, normal estimation, and semantic segmentation. This change adds the model configuration, image processor, and core modeling components to the library, enabling users to load and run the \google/tipsv2-b14-dpt\ checkpoint for high-accuracy scene understanding.
_src/transformers/models/tipsv2\dpt · high confidence
Add TVP model for video grounding
Introduces the TVP (Temporal Video Prompting) model, enabling video grounding tasks where a model predicts the start and end times of a specific event described by text within a video. This release includes the core PyTorch implementation (\TvpForVideoGrounding\), a configuration class (\TvpConfig\) supporting ResNet backbones, and dedicated image processors for both PIL and Torchvision backends to handle video frame preprocessing (resizing, padding, channel flipping). A unified processor (\TvpProcessor\) combines the tokenizer and image processor for end-to-end inference.
src/transformers/models/tvp · high confidence
Add Tencent HunYuan HYV4 model support
Adds the Tencent HunYuan HYV4 model, a large language model featuring Multi-Head Latent Attention (MLA), Deep Sparse Attention (DSA) with a dedicated indexer, and a Mixture-of-Experts (MoE) architecture with global expert routing. The implementation includes the \HYV4Config\ configuration class, the \HYV4ForCausalLM\ model, and associated components such as rotary embeddings and RMS normalization, enabling users to load and run the \tencent/Hy4-preview\ checkpoint.
_src/transformers/models/hy\v4 · high confidence
Add Time Series Transformer model
Introduces the Time Series Transformer model, enabling time-series forecasting with support for univariate and multivariate inputs, static categorical/real features, and dynamic real features. The model includes configuration options for prediction and context lengths, distribution output heads (Student-t, Normal, Negative Binomial), and scaling methods (mean, std, or none). It provides components for feature embedding, standardization, and mean scaling, along with outputs for sampling and prediction.
_src/transformers/models/decision\_transformer, src/transformers/models/higgs\_audio\_v2\_tokenizer, src/transformers/models/time\_series\transformer · high confidence
Add TimeSformer video understanding model
Introduces the TimeSformer model for video classification, including the \TimesformerConfig\, \TimesformerModel\, and \TimesformerForVideoClassification\ classes, along with a \TimesformerVideoProcessor\ for input handling and a conversion script to load pretrained checkpoints from the original TimeSformer repository.
src/transformers/models/timesformer · high confidence
Add TimesFM 2.5 time-series forecasting model
Introduces the TimesFM 2.5 model for time-series forecasting, including the \TimesFm2\_5Config\, \TimesFm2\_5ModelForPrediction\, and a conversion script to load the official \google/timesfm-2.5-200m\ checkpoint. The model supports configurable patch and context lengths, quantile-based predictions, and flip-invariance averaging.
_src/transformers/models/timesfm2\5 · high confidence
Add UDOP model support for document understanding
UDOP (Unified Document Understanding Pre-training) is now available as a new model in the library. This encoder-decoder architecture supports multimodal inputs, combining text, images, and bounding box coordinates to handle tasks like document question answering and visual document understanding. The release includes the \UdopConfig\, \UdopForConditionalGeneration\ model class, \UdopProcessor\ (integrating \LayoutLMv3ImageProcessor\ and \UdopTokenizer\), and a conversion script to load original Microsoft UDOP checkpoints into Hugging Face format.
src/transformers/models/udop · high confidence
Add UVDoc model support for document rectification
Users can now load and run the UVDoc model (checkpoint: PaddlePaddle/UVDoc\_safetensors) for document rectification. This change adds the model implementation, configuration classes (UVDocConfig, UVDocBackboneConfig), and a dedicated image processor that handles preprocessing (resizing, RGB-to-BGR conversion) and post-processing (applying predicted 2D Bezier mesh coordinates to rectify original images).
src/transformers/models/uvdoc · high confidence
Add UnivNet vocoder model for audio synthesis
Introduces the UnivNet model, a vocoder that generates high-fidelity audio waveforms from log-mel spectrograms, designed for integration with Tortoise TTS. This change adds the model implementation, configuration, feature extractor, and a conversion script to load pretrained checkpoints into the Hugging Face Transformers library.
src/transformers/models/univnet · high confidence
Add V-JEPA 2 model for video representation learning
Introduces the V-JEPA 2 model, a video foundation model that learns representations by predicting masked spatiotemporal patches. This release includes the core \VJEPA2Model\ and \VJEPA2ForVideoClassification\ implementations, a \VJEPA2Config\ for configuration, and a \VJEPA2VideoProcessor\ for input handling. To facilitate adoption, conversion scripts are provided to load pretrained weights from the original Facebook Research implementation (\convert\_vjepa2\_to\_hf.py\) and to convert existing classifier checkpoints for downstream tasks like Something-Something-v2 and Diving48 (\convert\_vjepa2\_classifier\_to\_hf.py\).
src/transformers/models/vjepa2 · high confidence
Add VITS text-to-speech model support
Introduces the VITS model for text-to-speech synthesis, including the \VitsConfig\ configuration class, the \VitsModel\ implementation, and the \VitsTokenizer\ for text preprocessing. The implementation supports multi-speaker setups via speaker embeddings, stochastic duration prediction, and configurable speaking rate and noise scales. A checkpoint conversion script is provided to load original VITS weights, and the tokenizer handles phonemization via \espeak\ and non-Roman character romanization via \uroman\.
src/transformers/models/vits · high confidence
Add ViT MSN (Masked Siamese Networks) model support
Introduces the ViT MSN model for masked image modeling and image classification, including the \ViTMSNConfig\, \ViTMSNModel\, and \ViTMSNForImageClassification\ classes, along with a checkpoint conversion script to load weights from the original Facebook Research implementation.
_src/transformers/models/vit\msn · high confidence
Add ViTMatte model for image matting
Introduces the ViTMatte model, a new capability for image matting that estimates alpha mattes from input images and trimaps. This change adds the model implementation, configuration, and two image processors (a PyTorch/Torchvision backend and a PIL backend) to handle preprocessing tasks such as rescaling, normalization, and padding to a size divisor. It also includes a conversion script to migrate checkpoints from the original ViTMatte repository to the Hugging Face format.
src/transformers/models/vitmatte · high confidence
Add VidEoMT model for universal video segmentation
Introduces the VidEoMT (Video Mask Transformer) model, enabling universal segmentation on video inputs. This addition includes the core architecture (VideomtForUniversalSegmentation), configuration (VideomtConfig), and a dedicated video processor (VideomtVideoProcessor) for handling multi-frame inputs and post-processing segmentation masks. A checkpoint conversion script is also provided to load official VidEoMT weights from the Hugging Face Hub, supporting various DINOv2-based backbone sizes and datasets like YTVIS and OVIS.
src/transformers/models/videomt · high confidence
Add VideoLlava model support
Introduces the VideoLlava model, a multimodal architecture combining a vision backbone (CLIP) and a language model (Llama) to process both images and video. This change adds the core components for the \video\_llava\ module: \VideoLlavaConfig\ for configuration, \VideoLlavaModel\ and \VideoLlavaForConditionalGeneration\ for inference, \VideoLlavaProcessor\ for handling text and visual inputs, and dedicated image and video processors. It also includes a conversion script to migrate weights from the original LanguageBind/Video-LLaVA repository to the Hugging Face format.
_src/transformers/models/video\llava · high confidence
Add VisionTextDualEncoder model and processor
Introduces the VisionTextDualEncoder model, which combines a vision encoder and a text encoder to perform image-text contrastive learning. The package includes the model implementation, a configuration class for managing sub-model configs and projection dimensions, and a processor that wraps an image processor and a tokenizer for unified input handling.
_src/transformers/models/vision\_text\_dual\encoder · high confidence
Add VisualBERT model support
Introduces the VisualBERT model, enabling users to load and run a vision-and-language transformer that combines text and image embeddings. This includes the \VisualBertConfig\ and \VisualBertModel\ classes, along with specialized heads for pre-training, question answering, visual reasoning, and multiple-choice tasks. A conversion script is also provided to migrate original PyTorch checkpoints (e.g., from VQA or NLVR2 datasets) to the Hugging Face format.
_src/transformers/models/visual\bert · high confidence
Add VitPose model for human pose estimation
Introduces the VitPose model, a Vision Transformer-based architecture for 2D human pose estimation. This addition includes the model implementation (VitPoseForPoseEstimation), configuration (VitPoseConfig), and image processors (VitPoseImageProcessor and VitPoseImageProcessorPIL) to handle input preprocessing. A checkpoint conversion script is also provided to migrate weights from the original ViTPose repository, supporting various model sizes (base, plus, small, large, huge) and decoder types (simple and classic).
src/transformers/models/vitpose · high confidence
Add Voxtral Realtime multimodal model for audio-text processing
Introduces the Voxtral Realtime model, a multimodal architecture that combines a text language model with an audio encoder to process speech and text together. This release includes the model implementation (VoxtralRealtimeForConditionalGeneration), configuration classes (VoxtralRealtimeConfig, VoxtralRealtimeTextConfig, VoxtralRealtimeEncoderConfig), a feature extractor for mel-filter bank audio features, and a processor that integrates with the Mistral Common tokenizer for streaming and offline audio transcription. A weight conversion script is also provided to map original model weights to the Hugging Face format, enabling users to load and run the model for real-time audio understanding tasks.
_src/transformers/models/voxtral\realtime · high confidence
Add Wav2Vec2Conformer speech model
Introduces the Wav2Vec2Conformer model for speech recognition and related tasks. This addition includes the model configuration, core implementation, and a converter script to load original Fairseq checkpoints. Users can now utilize this architecture for pre-training, CTC-based transcription, sequence classification, and XVector embedding extraction.
_src/transformers/models/wav2vec2\conformer · high confidence
Add X-CLIP model support for video-text retrieval
Users can now load and run the X-CLIP model (microsoft/xclip-base-patch32) to perform video-text similarity and retrieval tasks. This release includes the model architecture, configuration, and a processor that handles video frames via the image processor, along with a conversion script to migrate original PyTorch weights to the Hugging Face format.
_src/transformers/models/x\clip · high confidence
Add X-Codec audio codec model
Introduces the X-Codec model, a new audio codec implementation in the Transformers library. This includes the model architecture (XcodecModel), its configuration (XcodecConfig), and a dedicated weight conversion script to load original X-Codec checkpoints into the Hugging Face format. Users can now encode and decode audio using the X-Codec architecture.
src/transformers/models/xcodec · high confidence
Add X-MOD multilingual masked language model
Introduces the X-MOD model, a multilingual masked language model supporting language adapters for multiple languages. This includes the XmodConfig configuration class, the XmodModel implementation with support for language-specific adapters, and a conversion script to load original Fairseq X-MOD checkpoints into the Hugging Face Transformers format.
src/transformers/models/xmod · high confidence
Add Xiaomi MiMo-V2-Flash model support
Users can now load and run the Xiaomi MiMo-V2-Flash model using the Hugging Face Transformers library. This new architecture features a hybrid design with a dense first layer followed by Mixture-of-Experts (MoE) layers, utilizing group-based top-k routing and distinct RoPE parameters for full and sliding attention windows. The release includes the model implementation, configuration, and a weight conversion script to migrate from the original Hub format.
_src/transformers/models/mimo\_v2\flash · high confidence
Add Youtu-LLM model support
Users can now load and run the Tencent Youtu-LLM model (e.g., tencent/Youtu-LLM-2B) via the \YoutuConfig\ and \YoutuForCausalLM\ classes. The implementation is modular, inheriting from DeepSeek V3, Llama, and Qwen3 components, and supports features like rotary embeddings with interleaving, RMS normalization, and tensor parallelism plans.
src/transformers/models/youtu · high confidence
Add mLUKE model and tokenizer support
Users can now utilize the mLUKE model, a multilingual variant of LUKE designed for Japanese and other languages, via the \MLukeTokenizer\ and associated model classes. This addition includes the tokenizer implementation for handling entity-aware tokenization and a conversion script to migrate original PyTorch checkpoints to the Hugging Face format, enabling pre-trained mLUKE models to be loaded and used for tasks such as entity classification and masked language modeling.
src/transformers/models/mluke · high confidence
Add modular-transformers examples demonstrating the modular model converter
The \examples/modular-transformers\ directory now includes a set of example files that demonstrate how to use the \modular\_converter\ linter. This tool unpacks Python inheritance in modular model files (like \modular\_gemma.py\) and converts them into single-file model implementations using \libcst\ to preserve docstrings and formatting. The examples cover various configuration scenarios, including dummy models, multimodal setups, and global indexing, providing templates for users to create new modular models.
examples/modular-transformers · high confidence
Add new repository quality-checking scripts
Added several new utility scripts to the \utils/\ directory to enforce repository consistency and documentation quality: \add\_dates.py\ automatically populates release dates in model documentation cards by analyzing git history and paper metadata; \check\_config\_docstrings.py\ validates that all configuration classes include a valid model checkpoint link in their docstrings; \check\_doc\_toc.py\ ensures the documentation table of contents is sorted and free of duplicates; and \aggregate\_failure\_reports.py\ combines multiple CI failure report JSON files into a single summary. These tools help maintain high standards for model documentation and configuration metadata across the library.
utils · high confidence
Add support for DeepseekAI's DeepseekVL multimodal model
Users can now load and run DeepseekVL, a vision-language model that combines a SigLIP vision encoder and a Llama text decoder. This release includes the model implementation, configuration, image processors (with both Torchvision and PIL backends), a unified processor, and a weight conversion script to migrate from the original Deepseek checkpoint format to Hugging Face Transformers.
_src/transformers/models/deepseek\vl · high confidence
Add support for GLM models
Users can now load and run GLM models (such as GLM-4) using the Hugging Face Transformers library. This change introduces the GlmConfig, GlmModel, and GlmForCausalLM classes, along with a utility script to convert original GLM weights into the Hugging Face format. The implementation leverages existing Llama and Phi3 components for attention and MLP layers while providing model-specific RoPE and configuration handling.
src/transformers/models/glm · high confidence
Add support for Google's Gemma language model
Users can now load and run Google's Gemma models (2B and 7B) using the \GemmaForCausalLM\, \GemmaModel\, and \GemmaConfig\ classes. This release includes the core modeling implementation, a SentencePiece-based tokenizer, and a conversion script to transform official Gemma checkpoints into the Hugging Face Transformers format. The model supports standard generation and inference workflows out of the box.
src/transformers/models/gemma · high confidence
Add support for InternVL (2.5 MPO and 3) multimodal models
Users can now load and run the InternVL family of vision-language models, including the 2.5 MPO variants (1B to 78B) and the InternVL3 series (1B to 78B). This change introduces the full model implementation, configuration classes (InternVLConfig, InternVLVisionConfig), and dedicated processors (InternVLProcessor, InternVLVideoProcessor) to handle text, images, and video inputs. A weight conversion script is also provided to migrate existing OpenGVLab checkpoints to the Hugging Face format, supporting both Qwen2 and Llama-based language backends.
src/transformers/models/internvl · high confidence
Add support for JetBrains' Mellum v2 code generation model
Users can now load and run the Mellum v2 model (e.g., JetBrains/Mellum2-12B-A2.5B-Base) using the standard Hugging Face Transformers API. This new architecture supports mixed dense and sparse (MoE) layers, configurable sliding windows, and distinct RoPE parameters for different layer types, enabling efficient inference for code generation tasks.
src/transformers/models/mellum · high confidence
Add support for LG AI EXAONE-MoE model
Users can now load and run the LG AI EXAONE-MoE model (checkpoint LGAI-EXAONE/K-EXAONE-236B-A23B) via the Hugging Face Transformers library. This new architecture combines Exaone4 attention with a Mixture-of-Experts (MoE) feed-forward network, supporting features like sliding window attention patterns, expert routing with configurable top-k selection, and tensor/expert parallelism plans for distributed inference.
_src/transformers/models/exaone\moe · high confidence
Add support for Microsoft KOSMOS-2.5 multimodal model
Introduces the KOSMOS-2.5 model, a multimodal architecture that processes both image and text inputs. This release includes the core PyTorch implementation (\modeling\_kosmos2\_5.py\), configuration classes (\Kosmos2\_5Config\, \Kosmos2\_5TextConfig\, \Kosmos2\_5VisionConfig\), and a unified processor (\Kosmos2\_5Processor\) that handles tokenization and image patch extraction. It also provides image processors for both Torchvision and PIL backends, along with a conversion script to load original Microsoft checkpoints into the Hugging Face format.
_src/transformers/models/kosmos2\5 · high confidence
Add support for Microsoft Phi models
Users can now load and run Microsoft's Phi-1, Phi-1.5, and Phi-2 models using the \PhiConfig\, \PhiModel\, and \PhiForCausalLM\ classes. This release includes a weights conversion script to transform original Microsoft checkpoints into the Hugging Face format, and the model implementation supports partial rotary embeddings, QK layer normalization, and Flash Attention 2 for improved performance.
src/transformers/models/phi · high confidence
Add support for MiniMax-Text-01 model
Users can now load and run the MiniMax-Text-01 model using the \MiniMaxModel\ and \MiniMaxConfig\ classes. This new architecture features a mixture-of-experts (MoE) design with 8 local experts, alternating between full and linear attention layers, and includes specific tensor parallelism, pipeline parallelism, and expert parallelism plans for distributed inference.
src/transformers/models/minimax · high confidence
Add support for NVIDIA Nemotron models
Users can now load and run NVIDIA Nemotron models (e.g., nemotron-15b style) using the Hugging Face Transformers library. This change introduces the NemotronConfig, NemotronModel, and NemotronForCausalLM classes, along with a conversion script to transform NeMo (mcore) checkpoints into Hugging Face format. The implementation supports key features such as rotary position embeddings, GQA (Grouped Query Attention), and standard causal language modeling tasks.
src/transformers/models/nemotron · high confidence
Add support for NVIDIA RADIO vision models
Users can now load and run NVIDIA's RADIO vision encoder models (such as C-RADIOv4-H and Nemotron Omni variants) via the Hugging Face Transformers library. This change introduces the RadioConfig, RadioModel, and RadioPreTrainedModel classes, enabling features like Cropped Position Embeddings (CPE), support for temporally-packed video inputs, and flexible image grid packing. The implementation is exposed through the standard \AutoModel\ and \AutoConfig\ interfaces, allowing seamless integration with existing pipelines.
src/transformers/models/radio · high confidence
Add support for PP-OCRv5 server detection model
Users can now load and run the PP-OCRv5 server detection model (model type \pp\_ocrv5\_server\_det\) using the Hugging Face Transformers library. This new capability includes the model architecture, a dedicated image processor that handles resizing, normalization, and BGR-to-RGB conversion, and a configuration class that defaults to a single 'text' detection class. The model is available via \AutoModel\ and \AutoImageProcessor\ and uses the checkpoint \PaddlePaddle/PP-OCRv5\_server\_det\_safetensors\.
_src/transformers/models/pp\_ocrv5\_server\det · high confidence
Add support for the Zyphra ZAYA1-8B model
Users can now load and run the Zyphra ZAYA1-8B model using the Hugging Face Transformers library. This new model features a hybrid architecture with 16 MoE experts, Compressed Convolutional Attention (CCA), and hybrid sliding-window attention. A weight conversion script is included to migrate legacy alternating-layer checkpoints to the native decoder-layer layout, and the model supports FSDP expert parallelism plans.
src/transformers/models/zaya · high confidence
Auto classes refactored to support dynamic model loading from the Hub
The auto-mapping system in \src/transformers/models/auto\ has been refactored to dynamically load model code from the Hugging Face Hub instead of relying solely on static, pre-defined mappings. This change introduces lazy loading mechanisms (e.g., \\_LazyConfigMapping\, \\LazyAutoMapping\) and updates the initialization logic in \\\init\\_.py\ to support dynamic module resolution. Users can now load models that are not yet included in the local library codebase, provided they have the necessary configuration and code registered on the Hub, enabling immediate support for new and custom models without waiting for a library release.
src/transformers/models/auto · high confidence
Automated model registry initialization
The \src/transformers/models/\_\init\\_.py\ file is now auto-generated to maintain the library's model registry. This change ensures that newly added model implementations are automatically exposed via the public API without requiring manual updates to the import structure, reducing the risk of missing or incorrect module registrations.
src/transformers/models · high confidence
ByT5 model and tokenizer support added
Users can now utilize the ByT5 model, which operates on raw byte sequences rather than subword tokens. This change introduces the \ByT5Tokenizer\ class for handling UTF-8 byte encoding, a PyTorch implementation of the model architecture, and a utility script to convert pre-trained TensorFlow checkpoints to PyTorch format, enabling the use of existing ByT5 weights in the Hugging Face Transformers library.
src/transformers/models/byt5 · high confidence
DistilBERT model implementation added
The library now includes the DistilBERT model, providing users with a lighter, faster version of BERT for sequence classification, token classification, question answering, and masked language modeling tasks. This addition includes the model architecture, configuration, and tokenizer classes, enabling the use of DistilBERT for inference and training within the transformers framework.
src/transformers/models/distilbert · high confidence
ESMFold2 model ported to Transformers
ESMFold2 is now available as a native Transformers model, enabling users to load and run the protein structure prediction model using standard Hugging Face APIs. This port includes the model configuration, the core architecture with its atom encoder and diffusion denoiser, a dedicated generation mixin for the diffusion sampling loop, a checkpoint converter to bridge research weights, and self-contained protein featurization utilities.
src/transformers/models/esmfold2 · high confidence
Initial LLaMA model support
Adds the LLaMA model family to the library, including the \LlamaConfig\, \LlamaModel\, \LlamaForCausalLM\, and \LlamaTokenizer\ classes, along with a conversion script to load Meta's original weights. The implementation supports key architectural features such as Grouped-Query Attention (GQA), RMSNorm, and Rotary Position Embeddings (RoPE), and includes a weight converter that handles various model sizes (1B to 405B) and versions (1, 2, 3, 3.1, 3.2).
src/transformers/models/llama · high confidence
Initial PyTorch implementation of the T5 model family
Adds the first complete PyTorch implementation for the T5 (Text-to-Text Transfer Transformer) model family, including the \T5Config\ configuration class, the \T5Tokenizer\ (backed by the \tokenizers\ library), and the core \modeling\_t5.py\ architecture. This release introduces support for T5's specific features such as relative attention bias, RMSNorm-style layer normalization, and gated-GeLU feed-forward projections (T5 v1.1). It also provides utility scripts to convert original TensorFlow and T5X (Flax) checkpoints into the Hugging Face PyTorch format, enabling users to load and run pre-trained T5 models immediately.
src/transformers/models/t5 · high confidence
Initial release of LayoutLM model support
Users can now use the LayoutLM model for document understanding tasks. This change introduces the core PyTorch implementation, including the \LayoutLMConfig\ for configuration and \LayoutLMModel\ for the base architecture, along with its initialization module. The model supports word, position, and 2D bounding-box embeddings, enabling it to process document layouts effectively.
src/transformers/models/layoutlm · high confidence
Initial release of the Longformer model implementation
This change introduces the PyTorch implementation of the Longformer model, including its configuration (\LongformerConfig\), core modeling logic (\modeling\_longformer.py\), and a conversion script for migrating checkpoints from the original PyTorch Lightning implementation. The model supports global and local attention mechanisms, with output classes exposing both local and global attention weights when requested.
src/transformers/models/led, src/transformers/models/longformer, src/transformers/models/mt5 · high confidence
Initial support for OpenAI Whisper models
This change introduces the first official implementation of OpenAI's Whisper models to the library. It adds the complete model architecture (\WhisperModel\, \WhisperForConditionalGeneration\), configuration, feature extraction, tokenization, and processing components. The implementation includes support for multilingual speech recognition and translation, word-level timestamp generation, and long-form audio transcription. A conversion script is also provided to migrate OpenAI's original PyTorch checkpoints to the Hugging Face format.
src/transformers/models/whisper · high confidence
Initial support for PhoBERT tokenizer
Added the PhoBERT tokenizer implementation, including the \PhobertTokenizer\ class for handling Vietnamese text via Byte-Pair Encoding and the corresponding module initialization file. This enables users to tokenize inputs for the PhoBERT model using the standard Hugging Face Transformers interface.
src/transformers/models/phobert · high confidence
Initial support for the OPT model family
Users can now load and run Facebook's OPT (Open Pre-trained Transformer) models using the Hugging Face Transformers library. This change introduces the core model implementation, configuration, and a conversion script to migrate checkpoints from the original Fairseq/Meta implementation. It enables standard NLP tasks such as causal language modeling, sequence classification, and question answering for OPT architectures.
src/transformers/models/opt · high confidence
Initial support for the Segment Anything Model (SAM)
Adds the Segment Anything Model (SAM) to the library, including the PyTorch model implementation, configuration classes (SamConfig, SamVisionConfig, etc.), a processor for handling images and prompt inputs (points, boxes), and image processors supporting both PIL and Torchvision backends. Includes a conversion script to load original Meta AI checkpoints and exposes the model via the standard transformers API.
src/transformers/models/sam · high confidence
Initial support for the mBART multilingual model
Users can now load and run the mBART (multilingual BART) encoder-decoder model for translation and other sequence-to-sequence tasks. This change adds the MBartConfig, the PyTorch model implementation (MBartModel, MBartForConditionalGeneration, etc.), and the MBartTokenizer (backed by the tokenizers library) to the library. It also includes a conversion script to migrate original Fairseq mBART checkpoints to the Hugging Face format, enabling immediate use of pre-trained mBART models for multilingual generation.
src/transformers/models/mbart · high confidence
Integrations module reorganized and expanded with new quantization and kernel support
The \src/transformers/integrations\ package has been restructured to centralize third-party integrations, exposing a comprehensive set of new capabilities for quantization, expert models, and hardware acceleration. Users can now utilize AQLM, BitNet, EETQ, HQQ, Higgs, Metal, SINQ, and VPTQ quantization methods, alongside fine-grained FP8 and MXFP4 support for MoE models. The module also adds direct integration with DeepGEMM kernels for high-performance grouped matrix multiplications on Hopper and Blackwell GPUs, and provides a unified hub-kernel system for loading optimized attention and activation kernels. Additionally, new callbacks for Kubeflow and Trackio are available, and the module now exports tensor parallelism and flex-attention utilities.
src/transformers/integrations · high confidence
Introduce AFMoE model with hybrid attention and token-choice MoE routing
Users can now load and run the AFMoE (Adaptive Feedforward Mixture of Experts) model, available via \AfmoeModel\ and \AfmoeForCausalLM\. This architecture combines a hybrid attention pattern—alternating between full and sliding-window attention—with a token-choice routing mechanism that distributes tokens to a set of sparse experts alongside shared experts. The implementation supports standard Hugging Face workflows, including configuration via \AfmoeConfig\, caching for generation, and distributed training plans for pipeline and expert parallelism.
src/transformers/models/afmoe · high confidence
Introduce Bamba hybrid state-space model
Adds the Bamba model, a hybrid architecture combining Mamba2 linear attention with full attention layers, to the library. This includes the \BambaConfig\ for model parameters (such as \attn\_layer\_indices\ and \z\_loss\_coefficient\), the \BambaForCausalLM\ implementation with its specific attention and mixer layers, and a conversion script to migrate checkpoints from the \mamba\_ssm\ library into the Hugging Face format.
src/transformers/models/bamba · high confidence
Introduce BertGeneration model support
Adds the BertGeneration model, configuration, and tokenizer to the library, enabling users to load and run BERT-based sequence generation models. The implementation includes a PyTorch model with support for bidirectional and causal attention masks, caching for efficient auto-regressive generation, and gradient checkpointing, alongside a SentencePiece-based tokenizer.
_src/transformers/models/bert\generation · high confidence
Introduce Cohere ASR model support
Adds the Cohere ASR model, configuration, feature extractor, and processor to the library. The feature extractor implements a custom numpy-based Short Time Fourier Transform to generate mel-filter bank features, handling long audio inputs by splitting them at energy-based boundaries. The processor manages audio preprocessing and constructs decoder prompts with language and punctuation tokens. The model architecture is modular, reusing components from Moonshine and CLIP, and supports various attention implementations.
(repo-wide) · high confidence
Introduce Data2Vec models for audio, text, and vision
Adds the Data2Vec architecture to the library, providing implementations for audio, text, and vision modalities. This includes the model configurations (\Data2VecAudioConfig\, \Data2VecTextConfig\, \Data2VecVisionConfig\), the core PyTorch model implementations, and scripts to convert original Fairseq checkpoints to the Hugging Face format. Users can now load and use Data2Vec models for self-supervised learning tasks across these three domains.
src/transformers/models/data2vec · high confidence
Introduce DeiT (Data-efficient Image Transformers) model support
Users can now load and run DeiT models for image classification and masked image modeling tasks. This change adds the DeiT configuration, PyTorch implementation (including distillation token support and dynamic position embedding interpolation), and image processors (both PIL and Torchvision backends). A conversion script is also provided to migrate checkpoints from the timm library, and the model exports to ONNX with dynamic axes for image height and width.
src/transformers/models/deit · high confidence
Introduce DiffusionGemma model for image-text-to-text generation
Adds the DiffusionGemma model, a multimodal architecture combining a Gemma 4 vision encoder with a diffusion-based text decoder. This release includes the model implementation, configuration classes (DiffusionGemmaConfig, DiffusionGemmaTextConfig), a custom generation mixin with diffusion-specific parameters (e.g., max\_denoising\_steps, sampler\_config), and a utility script to convert Orbax checkpoints to Hugging Face format. Users can now load and generate text conditioned on images using this new model type.
_src/transformers/models/diffusion\gemma · high confidence
Introduce Donut model for document understanding
Adds the Donut (Document Understanding Transformer) model, enabling users to process scanned documents and extract structured information. This change introduces the \DonutSwin\ encoder, \DonutProcessor\ for image and text handling, and \DonutImageProcessor\ with support for both Torchvision and PIL backends, along with a checkpoint conversion script to migrate from the original Donut implementation.
src/transformers/models/donut · high confidence
Introduce ESM and ESMFold model support
Adds the ESM (Evolutionary Scale Modeling) and ESMFold protein language models to the library, including the \EsmModel\, \EsmForMaskedLM\, \EsmForSequenceClassification\, and \EsmForProteinFolding\ architectures, along with the \EsmTokenizer\ and a conversion script to migrate weights from the original Meta ESM/ESMFold implementations.
src/transformers/models/esm · high confidence
Introduce EmbeddingGemma2 multimodal embedding model
Adds the EmbeddingGemma2 model, a multimodal embedding architecture supporting text, image, audio, and video inputs. The implementation includes the model definition, configuration classes (EmbeddingGemma2Config and EmbeddingGemma2TextConfig), and processors (EmbeddingGemma2Processor and EmbeddingGemma2VideoProcessor) to handle multimodal tokenization and layout. It also provides a weight conversion script to transform Orbax checkpoints into the Hugging Face format, enabling compatibility with SentenceTransformers for tasks like retrieval and classification.
_src/transformers/models/embedding\gemma2 · high confidence
Introduce Gemma 4 Assistant model for assisted decoding
Added the \Gemma4AssistantForCausalLM\ model and its configuration (\Gemma4AssistantConfig\) to enable multi-token prediction-based assisted decoding with Gemma 4. The assistant model wraps a Gemma 4 Text backbone, reusing shared KV states across layers to skip their calculation, and optionally uses a \Gemma4AssistantMaskedEmbedder\ for ordered embeddings. It is designed to be used alongside a main Gemma 4 model via the \assistant\_model\ argument in generation to accelerate inference.
_src/transformers/models/gemma4\_assistant, src/transformers/models/gemma4\_unified\assistant · high confidence
Introduce Gemma4Unified multimodal model and processors
Adds the Gemma4Unified model architecture and its associated components, including configuration, modular implementation, weight conversion script, and processors for text, image, audio, and video inputs. This enables users to load and run the unified Gemma4 model variant with native support for multimodal inputs through the standard Hugging Face Transformers API.
_src/transformers/models/gemma4\unified · high confidence
Introduce GraniteMoeShared model with shared expert support
Adds the GraniteMoeShared model variant, which extends the existing GraniteMoe architecture by introducing a shared MLP component that processes tokens alongside the sparse mixture-of-experts (MoE) path. This new model includes a dedicated configuration class (GraniteMoeSharedConfig) defining parameters for shared intermediate sizes and multipliers, a modular implementation for the shared MLP and decoder layers, and the corresponding auto-generated modeling and initialization files to make the model available for inference and training.
src/transformers/models/granitemoeshared · high confidence
Introduce IBM Granite language model support
Adds the IBM Granite model family to the library, including the \GraniteConfig\, \GraniteModel\, and \GraniteForCausalLM\ classes. The implementation is modular, inheriting from the Llama architecture while introducing Granite-specific features such as configurable \embedding\_multiplier\, \residual\_multiplier\, \attention\_multiplier\, and \logits\_scaling\ parameters in the configuration. The model supports tensor parallelism and pipeline parallelism plans, and utilizes the standard Hugging Face caching and generation interfaces.
src/transformers/models/granite · high confidence
Introduce ImageGPT model with image processing and TensorFlow-to-PyTorch conversion
Adds the ImageGPT model to the library, including the PyTorch implementation (modeling\_imagegpt.py), configuration (configuration\_imagegpt.py), and two image processor variants (Torchvision and PIL backends) that handle resizing, normalization, and color quantization to discrete input IDs. Also provides a conversion script to migrate original TensorFlow 2 checkpoints to PyTorch, enabling users to load pretrained ImageGPT weights and process images for causal language modeling.
src/transformers/models/imagegpt · high confidence
Introduce LASR speech recognition model
Adds the LASR (Large-scale Audio Speech Recognition) model, a conformer-based architecture for automatic speech recognition. This release includes the full model implementation (\LasrEncoderModel\, \LasrForCTC\), configuration classes (\LasrEncoderConfig\, \LasrCTCConfig\), a feature extractor for mel-filter bank extraction, a Unigram-based tokenizer, and a combined processor. The model is based on the architecture from Google Health AI and is available via the \google/medasr\ checkpoint.
src/transformers/models/lasr · high confidence
Introduce Laguna model support with MoE and per-layer configuration
Users can now load and run the Laguna model (checkpoint poolside/laguna-XS.2) via the Hugging Face Transformers library. This new architecture supports Mixture-of-Experts (MoE) with 256 experts, configurable per-layer types (full attention vs. sliding window), and per-layer MLP types (dense vs. sparse). The implementation includes specific configuration options for MoE routing (such as logit softcapping and routed scaling) and attention gating granularity (per-head or per-element).
src/transformers/models/laguna · high confidence
Introduce LayoutLMv2 model with OCR-enabled image processing
Adds the LayoutLMv2 model implementation, including its configuration, PyTorch modeling, tokenizer, and a new processor pipeline. The processor integrates a Tesseract-based image processor that automatically extracts words and normalized bounding boxes from document images, allowing users to feed raw images and text directly without manually providing bounding boxes. The model supports spatial position embeddings and relative attention biases for document layout understanding, and the processor ensures correct mapping between images and tokenized samples even when handling overflowing tokens.
src/transformers/models/layoutlmv2 · high confidence
Introduce LightGlue model for keypoint matching
Adds the LightGlue model, a transformer-based architecture for keypoint matching, including its configuration, modular definition, eager-mode implementation, and image processors (Torchvision and PIL backends). Users can now load pretrained LightGlue checkpoints, process image pairs, and retrieve matched keypoints with scores. A conversion script is also provided to migrate original LightGlue weights to the Hugging Face format.
src/transformers/models/lightglue · high confidence
Introduce Llama4 multimodal model support
Adds the Llama4 model family, a multimodal architecture supporting both text and vision inputs. This includes the model implementation (\modeling\_llama4.py\) with Mixture-of-Experts (MoE) layers, vision encoders, and dynamic RoPE; configuration classes (\Llama4Config\, \Llama4TextConfig\, \Llama4VisionConfig\); an image processor (\image\_processing\_llama4.py\) handling tile-based image chunking; a unified processor (\processing\_llama4.py\) with a specific chat template for tool-use and image handling; and a weight conversion script (\convert\_llama4\_weights\_to\_hf.py\) to map original checkpoints to the Hugging Face format.
(repo-wide) · high confidence
Introduce Mask2Former model for universal segmentation
Adds the Mask2Former model, a universal segmentation architecture supporting semantic, instance, and panoptic segmentation tasks. This change introduces the core model implementation (\Mask2FormerForUniversalSegmentation\), its configuration (\Mask2FormerConfig\), and image processing utilities (\Mask2FormerImageProcessor\) for preprocessing inputs and post-processing outputs. It also includes a converter script to load weights from the original Meta PyTorch implementation and a modular definition for the image processor.
src/transformers/models/eomt, src/transformers/models/mask2former · high confidence
Introduce MobileViT model with image classification and semantic segmentation support
Adds the MobileViT model architecture, including its configuration, PyTorch implementation, and dedicated image processors (Torchvision and PIL backends). Users can now load MobileViT for image classification and semantic segmentation tasks, with the image processors handling specific preprocessing steps like channel order flipping and segmentation map label reduction. A conversion script is also provided to migrate checkpoints from the ml-cvnets library.
src/transformers/models/mobilevit · high confidence
Introduce ModernBERT Decoder model variant
Adds a new decoder-only variant of the ModernBERT architecture, exposing \ModernBertDecoderModel\, \ModernBertDecoderConfig\, and related components. This model supports causal language modeling with configurable layer types (full vs. sliding attention), per-layer RoPE parameters, and standard decoder features like past key-value caching.
_src/transformers/models/modernbert\decoder · high confidence
Introduce Nemotron ASR Streaming model for cache-aware real-time speech recognition
Adds the \NemotronAsrStreaming\ model, a streaming RNN-T architecture designed for real-time speech-to-text. This release includes the model implementation, configuration, feature extractor, and processor, along with a conversion script to load NeMo checkpoints. The model supports cache-aware chunked streaming, allowing audio to be processed incrementally via a generator of mel-spectrogram chunks, and provides a processor that manages lookahead contexts for low-latency decoding.
_src/transformers/models/nemotron\_asr\streaming · high confidence
Introduce NemotronH model support
Adds the NemotronH model implementation, including its configuration, modular definition, and generated modeling code. This enables users to load and run NVIDIA's Nemotron-H architecture, which features a hybrid design combining linear attention, Mamba-style state-space models, and Mixture-of-Experts (MoE) layers.
_src/transformers/models/nemotron\h · high confidence
Introduce OWL-ViT zero-shot object detection model
Adds the OWL-ViT model for zero-shot object detection, including the PyTorch implementation (\modeling\_owlvit.py\), configuration classes (\configuration\_owlvit.py\), image processors for Torchvision and PIL backends (\image\_processing\_owlvit.py\, \image\_processing\_pil\_owlvit.py\), and a unified processor (\processing\_owlvit.py\) that supports both text-prompted and image-guided detection. A conversion script (\convert\_owlvit\_original\_flax\_to\_hf.py\) is also provided to load checkpoints from the original Flax repository.
src/transformers/models/owlvit · high confidence
Introduce Perception Encoder Audio-Video model
Adds the \PeAudioVideoModel\ and \PeAudioVideoEncoder\ components, enabling the processing of combined audio and video inputs through a unified encoder that aligns modalities via nearest-neighbor interpolation and projects them into a shared representation. This release includes the model configuration (\PeAudioVideoConfig\), a dedicated processor (\PeAudioVideoProcessor\), and a conversion script to migrate weights from the original \facebook/pe-av-large\ checkpoint into the Hugging Face Transformers format.
_src/transformers/models/pe\_audio\video · high confidence
Introduce Phi-3 model support
Adds the Phi-3 model architecture to the library, including the \Phi3Config\ configuration class, the \Phi3Model\ implementation, and associated modular definitions. This enables users to load, configure, and run inference or training with Microsoft's Phi-3 models using the standard Hugging Face Transformers interface.
src/transformers/models/phi3 · high confidence
Introduce PoolFormer vision model
Adds the PoolFormer model for image classification, including the PyTorch implementation, configuration, and image processors (with both PIL and Torchvision backends supporting custom crop percentage). A conversion script is also provided to load original PoolFormer checkpoints into the Hugging Face format.
src/transformers/models/poolformer · high confidence
Introduce Prompt Depth Anything model for depth estimation
Adds the Prompt Depth Anything model, a new architecture for depth estimation that accepts prompt depth inputs alongside images. This change introduces the model configuration, PyTorch implementation, and both fast (Torchvision) and slow (PIL) image processors, along with a conversion script to migrate checkpoints from the original repository.
_src/transformers/models/prompt\_depth\anything · high confidence
Introduce PyTorch Marian model and tokenizer
Adds the PyTorch implementation for the Marian translation model, including the \MarianConfig\, \MarianModel\, \MarianMTModel\, and \MarianTokenizer\ classes, along with conversion scripts to port OPUS-MT and Tatoeba models to the Hugging Face format. This enables users to load, fine-tune, and generate text with Marian-based machine translation models directly using the Transformers library.
src/transformers/models/marian · high confidence
Introduce RegNet vision model support
Adds the RegNet architecture to the library, including the \RegNetConfig\ configuration class, the \RegNetModel\ and \RegNetForImageClassification\ PyTorch implementations, and conversion scripts to migrate checkpoints from timm and Vissl (including the RegNet 10B SEER models). Users can now load and run RegNet models for image feature extraction and classification using the standard Hugging Face Transformers API.
src/transformers/models/regnet · high confidence
Introduce SAM3 Tracker Video model for video object tracking
Adds the \Sam3TrackerVideo\ model, configuration, and processor to Hugging Face Transformers, enabling video object tracking capabilities. This new model extends the SAM2 video architecture with specific configurations for memory attention, mask decoding, and prompt encoding, and includes an inference session manager to handle stateful tracking across video frames.
_src/transformers/models/sam3\_tracker\video · high confidence
Introduce SAM3 Video model for video object tracking and segmentation
Adds the SAM3 Video model, configuration, processor, and checkpoint conversion script to the library. This new capability enables video object tracking and segmentation, supporting multi-prompt text inputs and configurable detection/tracking parameters (such as NMS thresholds, keep-alive counters, and hotstart delays). The implementation includes a dedicated inference session for managing state and vision feature caching, and integrates with the existing SAM3 detector and SAM2/SAM3 tracker backends.
_src/transformers/models/sam3\video · high confidence
Introduce ShieldGemma2 model for image policy classification
Adds the ShieldGemma2 model, a multimodal image classifier designed to evaluate images against safety policies (dangerous, sexual, violence) and support custom policy definitions. The release includes the model implementation (\ShieldGemma2ForImageClassification\), configuration, and a specialized processor that constructs prompts for batched image-policy classification. A weight conversion utility is also provided to transform Orbax checkpoints into the Hugging Face format.
src/transformers/models/shieldgemma2 · high confidence
Introduce SigLIP and SigLIP 2 multimodal models
Adds the SigLIP (and SigLIP 2) vision-language models to the library, including the core PyTorch implementation, configuration classes, image processors (with PIL and Torchvision backends), a SentencePiece-based tokenizer, and a combined processor. A checkpoint conversion script is also provided to load original Google BigVision weights into the Hugging Face format, enabling users to use these pre-trained models for image-text similarity and related tasks.
src/transformers/models/siglip · high confidence
Introduce SigLIP2 multimodal model
Adds the SigLIP2 model, a vision-language architecture supporting image and text processing. This includes the core model implementation, configuration classes for text and vision components, a tokenizer based on Gemma with lowercase normalization, and image processors supporting both PIL and Torchvision backends to handle patch-based image resizing and encoding.
src/transformers/models/siglip2 · high confidence
Introduce SmolVLM model and processors
Adds the SmolVLM multimodal model, including its configuration, modular definition, PyTorch implementation, and dedicated image, video, and text processors. This enables users to load, process, and run inference with the SmolVLM architecture, supporting both image and video inputs with specific prompt formatting and preprocessing logic.
src/transformers/models/smolvlm · high confidence
Introduce Speech2Text model and supporting components
Adds the Speech2Text model for speech-to-text conversion, including the configuration, feature extractor, tokenizer, processor, and PyTorch modeling implementation. The feature extractor supports mel-filter bank extraction with optional dithering and cepstral mean-variance normalization, while the processor combines the feature extractor and tokenizer for end-to-end audio-to-text input preparation. A conversion script is also provided to migrate Fairseq Speech2Text checkpoints to the Hugging Face format.
_src/transformers/models/speech\_to\text · high confidence
Introduce SpeechEncoderDecoder model for speech-to-text generation
Users can now build custom speech-to-text architectures by combining any Hugging Face speech encoder (e.g., Wav2Vec2) with any text decoder (e.g., BERT, MBart) using the new \SpeechEncoderDecoderModel\ and \SpeechEncoderDecoderConfig\. This location provides the core model implementation, configuration handling with automatic sub-config management, and utility scripts to convert original Fairseq Wav2Vec2 checkpoints into this generic encoder-decoder format.
_src/transformers/models/speech\_encoder\decoder · high confidence
Introduce SpeechT5 model for speech and text processing
Adds the SpeechT5 model, a multimodal architecture supporting speech-to-text, text-to-speech, and speech-to-speech tasks. This includes the core PyTorch implementation, a configuration class, a feature extractor for audio preprocessing, a tokenizer with an English number normalizer, and a processor to handle mixed audio-text inputs. The release also provides scripts to convert original Fairseq and HiFi-GAN checkpoints into the Hugging Face format, enabling users to leverage pre-trained SpeechT5 models for various speech and language tasks.
src/transformers/models/speecht5 · high confidence
Introduce Swin Transformer model support
Adds the Swin Transformer model to the library, including the configuration, PyTorch implementation, and modular definition. This enables users to load and run Swin models for tasks such as image classification, masked image modeling, and feature extraction. The change also includes conversion scripts to migrate checkpoints from the original Microsoft repository and the timm library, ensuring compatibility with existing pretrained weights.
src/transformers/models/swin · high confidence
Introduce Swin2SR model for image super-resolution
Adds the Swin2SR model, a transformer-based architecture for image super-resolution, denoising, and compression artifact reduction. This includes the \Swin2SRConfig\ for model parameters (such as upscale factor and upsampler type), \Swin2SRImageProcessor\ with both PIL and Torchvision backends for custom padding and rescaling, and the \Swin2SRModel\ implementation. A checkpoint conversion script is also provided to load weights from the original Swin2SR repository, enabling users to apply pre-trained models for tasks like classical, compressed, or real-world super-resolution.
src/transformers/models/swin2sr · high confidence
Introduce SwitchTransformers model support
Users can now load and run Switch Transformers, a sparse mixture-of-experts (MoE) encoder-decoder model. This change adds the \SwitchTransformersConfig\ and \SwitchTransformersForConditionalGeneration\ classes, along with utilities to convert original Flax/T5X checkpoints to PyTorch. The implementation includes a top-1 router with expert capacity accounting, jitter noise for load balancing, and auxiliary losses (z-loss and load-balancing loss) to stabilize training.
_src/transformers/models/switch\transformers · high confidence
Introduce TimmBackbone model for wrapping timm architectures
Adds a new \TimmBackbone\ model and its configuration (\TimmBackboneConfig\) that wraps \timm\ models as feature extractors within the Transformers library. This allows users to load any \timm\ checkpoint as a backbone, with support for configuring output indices, freezing BatchNorm layers, and handling feature-only outputs. The implementation includes lazy loading, SDPA support declaration, and specific handling for meta-device initialization and buffer management.
_src/transformers/models/timm\backbone · high confidence
Introduce TimmWrapper model integration
Adds a new \TimmWrapperModel\ that wraps models from the \timm\ library, allowing users to load and run \timm\ architectures (such as ResNet or ViT) directly within the Hugging Face Transformers ecosystem. This includes the \TimmWrapperConfig\ for specifying architectures and pooling behavior, a \TimmWrapperImageProcessor\ for handling input transforms compatible with \timm\, and the \TimmWrapperModel\ class which manages weight loading, gradient checkpointing, and SDPA support while exposing standard Transformer model outputs.
_src/transformers/models/timm\wrapper · high confidence
Introduce UperNet for semantic segmentation
Adds the UperNet model for semantic segmentation, including the \UperNetConfig\ and \UperNetForSemanticSegmentation\ classes, along with conversion scripts to migrate pretrained ConvNeXt and Swin Transformer checkpoints from OpenMMLab's mmsegmentation library. This enables users to load and run UperNet models for scene understanding tasks.
src/transformers/models/upernet · high confidence
Introduce ViT MAE model with PyTorch implementation and checkpoint converter
Adds the Vision Transformer with Masked Autoencoder (ViT MAE) model to the library, including the PyTorch implementation (modular and generated files), configuration, and a script to convert official Facebook Research checkpoints to Hugging Face format. Users can now load and run ViT MAE for self-supervised pretraining tasks, utilizing the provided image processor and model classes.
_src/transformers/models/vit\mae · high confidence
Introduce ViTDet model for object detection backbones
Adds the ViTDet model, a Vision Transformer-based backbone designed for object detection tasks. This new capability includes the \VitDetConfig\ configuration class, the \VitDetModel\ implementation with support for window attention and relative positional embeddings, and the necessary module exports to make the model available for use in the library.
src/transformers/models/vitdet · high confidence
Introduce ViViT video classification model
Adds the ViViT (Video Vision Transformer) model for video classification, including the \VivitConfig\, \VivitModel\, \VivitForVideoClassification\, \VivitImageProcessor\, and \VivitVideoProcessor\ classes, along with a converter script to migrate Flax checkpoints to PyTorch.
src/transformers/models/vivit · high confidence
Introduce VibeVoice Acoustic Tokenizer model
Adds the VibeVoice Acoustic Tokenizer, a new audio model component that converts audio waveforms into continuous latent representations and reconstructs audio from those latents. This release includes the model configuration, feature extractor, and PyTorch implementation, along with a conversion script to migrate existing VibeVoice checkpoints to the Hugging Face Transformers format.
_src/transformers/models/vibevoice\_acoustic\tokenizer · high confidence
Introduce VibeVoice multimodal speech synthesis model
Adds the VibeVoice model, a multimodal architecture for text-to-speech and voice cloning that combines a Qwen2 language model backbone with a diffusion head for acoustic latent synthesis. The implementation includes the model definition, configuration, and a custom generation mixin that handles classifier-free guidance and diffusion sampling via a diffusers noise scheduler. A dedicated processor manages audio tokenization and text-audio alignment, while a conversion script enables loading pretrained checkpoints from the original VibeVoice repository into the Hugging Face format.
src/transformers/models/vibevoice · high confidence
Introduce VideoLLaMA3 multimodal model
Adds the VideoLLaMA3 model, a vision-language architecture that processes both images and videos. The implementation includes configuration classes (VideoLlama3Config, VideoLlama3VisionConfig), a modular model definition, and dedicated processors for image and video inputs. The model supports axial rotary embeddings for vision attention and integrates with the standard Hugging Face Transformers pipeline for generation and feature extraction.
_src/transformers/models/video\_llama\3 · high confidence
Introduce VideoMAE model with video processor and multi-backend image processing
Adds the VideoMAE model to the library, including the core PyTorch implementation, configuration, and a new VideoMAEVideoProcessor that unifies video preprocessing. The model supports both pre-training (masked autoencoding) and video classification tasks, with a dedicated script to convert original VideoMAE checkpoints (base, small, large, huge) from the MCG-NJU repository into Hugging Face format. Image preprocessing is now handled by two backends—PIL and Torchvision—allowing users to choose their preferred processing engine while maintaining consistent resizing, cropping, and normalization for video frames.
src/transformers/models/videomae · high confidence
Introduce Vision Transformer (ViT) model support
Adds the Vision Transformer (ViT) model to the library, including the \ViTConfig\ configuration class, \ViTModel\ and \ViTForImageClassification\ PyTorch implementations, and dedicated image processors (\ViTImageProcessor\) for standardizing input preprocessing. The change also provides conversion scripts to migrate pretrained weights from the \timm\ library and DINO-trained checkpoints into the Hugging Face format, enabling users to leverage these pre-trained vision models for feature extraction and image classification tasks.
src/transformers/models/vit · high confidence
Introduce Voxtral multimodal model for audio and text
Adds the Voxtral model, a multimodal architecture combining a Whisper-based audio encoder with a Llama language model, enabling users to process mixed audio and text inputs. The release includes the model implementation, configuration, and a dedicated processor that handles audio feature extraction and chat template application, along with a weight conversion script to load original Voxtral checkpoints into the Hugging Face format.
src/transformers/models/voxtral · high confidence
Introduce Wav2Vec2Bert speech model
Adds the Wav2Vec2Bert model, a speech foundation model combining Wav2Vec2 and BERT architectures. This release includes the model implementation (modular and generated files), configuration, processor, and a checkpoint converter for seamless migration from Fairseq/Seamless checkpoints. Users can now load and run Wav2Vec2Bert for tasks like speech recognition and classification using the standard Hugging Face Transformers API.
_src/transformers/models/wav2vec2\bert · high confidence
Introduce Wav2Vec2Phoneme tokenizer with phonemization and CTC output
Adds the Wav2Vec2Phoneme tokenizer, enabling automatic phonemization of input text using the espeak backend and returning CTC-style outputs that include character-level time offsets. Users can now tokenize audio transcripts for Wav2Vec2 models with phoneme support, configuring language and backend options directly in the tokenizer initialization.
_src/transformers/models/wav2vec2\phoneme · high confidence
Introduce WavLM speech model
Adds the WavLM model, including its configuration, modular and concrete modeling files, and checkpoint conversion scripts for original PyTorch and S3PRL weights. This enables users to load and run WavLM-based architectures for tasks such as sequence classification, audio frame classification, and XVector extraction.
(repo-wide) · high confidence
Introduce Xcodec2 audio codec model
Adds the Xcodec2 model, a new audio codec supporting both acoustic encoding/decoding and semantic feature extraction. This includes the model implementation, configuration, feature extractor, and a checkpoint converter to migrate weights from the original HKUSTAudio implementation.
src/transformers/models/xcodec2 · high confidence
Introduce benchmark\_v2 framework with device-agnostic GPU monitoring and tensor parallelism support
The benchmark\_v2 framework is now available in the \benchmark\_v2/framework\ directory, providing a new configuration and execution engine for model benchmarks. This update introduces device-agnostic support, allowing benchmarks to run on various torch accelerators (including Intel XPU) rather than being limited to CUDA. It adds native support for tensor parallelism via \DistributedConfig\ and continuous batching, while improving GPU monitoring by switching to multiprocessing and using \amdsmi\ for AMD GPUs alongside \pynvml\ for NVIDIA. The framework also integrates \torch.compile\ support and validates attention implementation availability (flash attention 2, SDPA, etc.) to ensure correct benchmark execution.
_benchmark\v2/framework · high confidence
Introduce heterogeneous model configuration support
Users can now define per-layer configuration overrides for models where individual layers differ from the global settings (e.g., varying intermediate sizes or skipped layers). This is achieved via a new \HeterogeneousConfigMixin\ and \per\_layer\_config\ mechanism that validates indices and attributes, allowing explicit customization of specific layers within a model architecture.
src/transformers/integrations/heterogeneity · high confidence
Introduce modular XLM model implementation
The XLM model is now available as a fully modular implementation, replacing the previous legacy structure. This change introduces new files for the configuration (\XLMConfig\), PyTorch modeling (\XLMModel\ and related heads), and tokenization (\XLMTokenizer\), along with a conversion script to migrate original PyTorch checkpoints. Users can now import XLM components via the standard modular paths, benefiting from updated type hints, auto-generated docstrings, and alignment with the library's current architecture standards.
src/transformers/models/xlm · high confidence
Introduce native distributed training and inference orchestration
This change introduces a new \src/transformers/distributed\ package that provides native support for tensor parallelism (TP), expert parallelism (EP), pipeline parallelism (PP), and Fully Sharded Data Parallelism (FSDP2). It adds a \DistributedConfig\ dataclass to define parallel sizes and sharding plans, a \DistributedMixin\ to integrate these capabilities into model loading and saving, and utility modules for device mesh management, FSDP policy application, and sharded checkpoint loading via \DtensorShardOperation\. Users can now configure and run distributed training or inference directly through the library without relying solely on external orchestrators like Accelerate for these specific parallelism strategies.
src/transformers/distributed · high confidence
Introduce new continuous batching cache and logits processing infrastructure
This change adds the foundational components for the new continuous batching implementation, specifically introducing the \PagedAttentionCache\ for managing KV cache memory across different attention types (full and sliding) and the \ContinuousBatchingLogitsProcessorList\ to handle per-request logits processing during batched generation. Users benefit from a more robust and flexible memory management system that supports block sharing and sliding windows, along with the ability to apply custom logits processors on a per-request basis within the continuous batching context.
_src/transformers/generation/continuous\batching · high confidence
Introduce new modular ResNet implementation with backbone support
The ResNet model has been replaced with a new, modular implementation that integrates with the library's backbone infrastructure. Users can now configure specific output stages via \out\_indices\ and \out\_features\ in \ResNetConfig\, and the model returns \BackboneOutput\ or \ImageClassifierOutputWithNoAttention\ depending on usage. A new script (\convert\_resnet\_to\_pytorch.py\) is provided to convert pre-trained weights from the \timm\ library (resnet18, 26, 34, 50, 101, 152) to the Hugging Face format, and the model exposes \downsample\_in\_first\_stage\ and \downsample\_in\_bottleneck\ configuration options to control downsampling behavior.
src/transformers/models/resnet · high confidence
Introduce official Falcon model support with conversion tooling
Adds the Falcon model implementation to the library, including the configuration, modeling, and initialization modules, along with a conversion script to migrate legacy custom-code checkpoints (using \RWForCausalLM\) to the standard Hugging Face format. This allows users to load and run Falcon models without \trust\_remote\_code=True\ and enables features like Flash Attention 2 and RoPE scaling.
src/transformers/models/falcon · high confidence
Introduce structured CI Docker images with \`uv\` and \`docker buildx bake\`
The repository now provides a standardized set of Docker images for CI environments, organized under the \docker/\ directory. These images (including \ci-base\, \torch-light\, \quality\, \consistency\, \custom-tokenizers\, \examples-torch\, \exotic-models\, and \pipeline-torch\) are built using \docker buildx bake\ and a \docker-bake.hcl\ configuration, allowing users to easily construct specific CI environments. The images use \uv\ for faster package installation, pin PyTorch to version 2.14.0 or lower for CPU compatibility, and include pre-fetched test data to optimize CI performance. A new \README.md\ documents how to build and use these images, which are designed to support both CPU-only and GPU-capable workflows for running transformers tests.
docker · high confidence
Introduce unified HfQuantizer framework for quantization loading
The \src/transformers/quantizers\ package now provides a centralized, unified architecture for loading quantized models. It introduces the \HfQuantizer\ abstract base class and an \AutoHfQuantizer\ dispatcher that automatically routes model loading to the correct quantization handler (e.g., Bitsandbytes, AWQ, GPTQ, AQLM, CompressedTensors, FP8, etc.) based on the model's configuration. This replaces scattered, method-specific loading logic with a consistent interface, ensuring that quantized models are correctly initialized, validated, and processed during \from\_pretrained\.
src/transformers/quantizers · high confidence
Introduction of Benchmarking v2 framework with Hub integration
The \benchmark\_v2\ directory now contains a new comprehensive benchmarking framework for transformer models, replacing or supplementing previous versions. This includes a top-level \run\_benchmarks.py\ script that discovers and executes benchmarks from the \benches/\ directory, supporting multiple execution modes (eager, compiled, kernelized) and detailed performance metrics collection. Users can now run benchmarks with configurable parameters such as batch size, sequence length, and warmup/iteration counts, and optionally enable tensor parallelism. A key addition is the ability to automatically upload benchmark results to a HuggingFace Dataset via the \--push-result-to-dataset\ argument, facilitating centralized tracking and analysis of model performance across different configurations and hardware setups.
_benchmark\v2 · high confidence
Introduction of MBart50 tokenizer with fairseq vocabulary alignment
The MBart50 tokenizer is now available, implemented using the HuggingFace tokenizers library (TokenizersBackend) instead of the previous slow implementation. It specifically handles fairseq vocabulary alignment, ensuring correct token indexing for the 50+ language codes and special tokens required by the MBart-large-50 model. Users can now instantiate the tokenizer via \MBart50Tokenizer.from\_pretrained\ with support for source and target language specification.
src/transformers/models/mbart50 · high confidence
Introduction of TrOCR model for handwritten and printed text recognition
Users can now utilize the TrOCR (Transformer-based Optical Character Recognition) model, a sequence-to-sequence architecture combining a Vision Transformer (ViT) encoder with a RoBERTa decoder, to transcribe images of handwritten or printed text into text. This release includes the core model implementation (\TrOCRForCausalLM\), its configuration (\TrOCRConfig\), and a dedicated processor (\TrOCRProcessor\) that handles both image preprocessing and tokenization. A checkpoint conversion script is also provided to migrate weights from the original UniLM repository, enabling immediate use of pre-trained models like \microsoft/trocr-base-handwritten\ for document transcription tasks.
src/transformers/models/trocr · high confidence
Introduction of Wav2Vec2ProcessorWithLM with N-best hypotheses and timing support
The \Wav2Vec2ProcessorWithLM\ is now available to handle speech recognition with language models, supporting the return of N-best hypotheses and word-level timestamps via the new \Wav2Vec2DecoderWithLMOutput\ dataclass. This processor integrates feature extraction, tokenization, and CTC decoding (via \pyctcdecode\) into a single interface, allowing users to access logit scores, language model scores, and word offsets for precise alignment analysis.
_src/transformers/models/wav2vec2\_with\lm · high confidence
Introduction of the GPT-2 model implementation
This change introduces the core GPT-2 model components to the library, including the \GPT2Config\ configuration class, the \GPT2Model\ PyTorch implementation with support for cross-attention and caching, and the \GPT2Tokenizer\ for byte-level BPE tokenization. It also provides a conversion script to migrate checkpoints from the original TensorFlow implementation to PyTorch and documentation for converting Megatron-LM checkpoints.
src/transformers/models/gpt2 · high confidence
Introduction of the TAPAS model for table question answering
This change introduces the TAPAS (Table PAralleled Sentence) model, enabling users to perform question answering on tabular data. The implementation includes the \TapasConfig\ for model hyperparameters, the \TapasTokenizer\ for encoding tables and questions with specific token types (segment, column, row, etc.), and the PyTorch \TapasModel\ with its various heads (ForQuestionAnswering, ForMaskedLM, ForSequenceClassification). A conversion script is also provided to load original TensorFlow checkpoints into PyTorch, and the module is registered in the library's auto-generated initialization file.
src/transformers/models/tapas · high confidence
Introduction of the VisionEncoderDecoder model architecture
Users can now combine a vision encoder (such as ViT) with a text decoder (such as BERT or GPT) into a single unified model for tasks like image captioning. This change introduces the \VisionEncoderDecoderModel\ class and its corresponding \VisionEncoderDecoderConfig\, which automatically manages the encoder and decoder sub-configurations, handles hidden-size projection when necessary, and supports features like gradient checkpointing and Flash Attention.
_src/transformers/models/vision\_encoder\decoder · high confidence
Introduction of the data module with data collators and processors
The \src/transformers/data\ package is introduced, providing a centralized location for data processing utilities. This includes a suite of data collators (such as \DataCollatorForLanguageModeling\, \DataCollatorWithPadding\, and \DefaultDataCollator\) that handle batching and padding of input features for various model types, as well as data processors and metrics for standard NLP benchmarks like GLUE and SQuAD. This change organizes these components into a dedicated module, making them importable from \transformers.data\ and establishing a consistent interface for data preparation in training pipelines.
src/transformers/data · high confidence
Japanese BERT tokenizer now supports multiple word and subword tokenizers
The \BertJapaneseTokenizer\ in \src/transformers/models/bert\_japanese\ has been expanded to support a wider variety of tokenization strategies. Users can now choose from multiple word tokenizers (\basic\, \mecab\, \sudachi\, \jumanpp\) via the \word\_tokenizer\_type\ argument, and multiple subword tokenizers (\wordpiece\, \character\, \sentencepiece\) via the \subword\_tokenizer\_type\ argument. This allows for more flexible Japanese text processing depending on the available libraries (e.g., SudachiPy, Juman++, SentencePiece) and specific linguistic requirements.
_src/transformers/models/bert\japanese · high confidence
New GGUF integration module for loading and running quantized models
A new \src/transformers/integrations/gguf\ package has been added to enable loading and inference of GGUF-format models directly within the library. This module provides a complete pipeline: a reader (\reader.py\) parses GGUF metadata and tensor tables; a dequantization engine (\dequant.py\) handles various GGML quantization types (Q2\_K through Q8\_0, IQ1\_S, etc.) using PyTorch operations; and optimized kernels (\kernels.py\) allow weights to remain packed during inference for improved performance. The integration includes architecture-specific configuration builders (\gguf\_config\_mapping.py\) and weight conversion mappings (\gguf\_conversion\_mapping.py\) that handle name renaming and layout transformations for supported models like Qwen3.5 and Qwen3.5-MoE. Additionally, a tokenizer builder (\gguf\_tokenizer\_mapping.py\) reconstructs tokenizers from GGUF metadata, supporting various tokenization schemes (SentencePiece, BPE, Unigram) and special token handling.
src/transformers/integrations/gguf · high confidence
New LLaMA benchmark for measuring model load and generation performance
Added a new benchmark script (benchmark/benches/llama.py) that measures the load time and generation speed of the LLaMA-2-7b model. The benchmark captures CPU, memory, and GPU metrics during execution and supports both eager execution and static caching modes to help users evaluate inference performance.
benchmark/benches · high confidence
New benchmarking infrastructure with database-backed metrics and Grafana visualization
The benchmark directory now includes a complete infrastructure for running and tracking model performance. It introduces a \MetricsRecorder\ class that captures device and model measurements, storing them in a PostgreSQL database (via psycopg2) and optionally exporting to CSV. A new \benchmarks\_entrypoint.py\ serves as the main entry point for executing benchmarks, while \benchmark.py\ provides a wrapper around the \optimum-benchmark\ library to handle commit checking and result summarization. Additionally, Grafana configuration files (\grafana\_dashboard.json\, \grafana\_datasource.yaml\, \default.yml\) are added to visualize the benchmark results against the metrics database.
benchmark · high confidence
New continuous batching benchmark suite with distributed and accuracy tracking
A new benchmark script (\continuous\_batching\_overall.py\) has been added to the benchmark scripts directory. This tool allows users to run continuous batching benchmarks in-process, supporting both tensor parallelism (via \--tp-size\) and data parallelism (via \--dp-size\ using torchrun). It evaluates throughput and end-to-end latency on synthetic data, as well as accuracy on GSM8K-Platinum and IFEval tasks using lighteval. Results are saved as timestamped JSON files and can be compared against previous runs using the \--compare-to\ flag.
_benchmark\_v2/benchmark\scripts · high confidence
New continuous batching generation examples and evaluation scripts
Added three new example scripts in the \examples/generate\ directory to demonstrate and benchmark continuous batching capabilities. \continuous\_batching.py\ provides a comprehensive benchmarking tool that compares standard generation against continuous batching, supporting detailed configuration of KV cache blocks, CUDA graphs, and compilation levels. \continuous\_batching\_simple.py\ offers a streamlined example using the Qwen3-4B model on the GSM8K dataset to showcase basic batch generation performance. \transformers\_serve\_cb\_eval\_job.py\ enables users to serve a model with continuous batching via \transformers serve\ and automatically evaluate it using the \inspect-ai\ framework against the GPQA Diamond dataset.
examples/generate · high confidence
New declarative response parsing system for chat templates
Introduces a new \src/transformers/utils/chat\_parsing\ module that replaces ad-hoc parsing with a structured, streaming-capable \ResponseParser\. Users can now define how model output is converted into assistant messages using a declarative \response\_template\ spec, which supports multiple content parsers (text, int, float, bool, json, xml-inline, kv-lines) and configurable JSON dialects (e.g., unquoted keys, custom string delimiters). The parser handles streaming events, processes chat prefixes to account for template prefills, and casts tool-call arguments using the calling tool's JSON schema.
_src/transformers/utils/chat\parsing · high confidence
New examples for custom and INT8 symmetric quantization
Added two new example scripts in the quantization directory: \custom\_quantization.py\ demonstrates how to register and use a custom quantization configuration and quantizer, while \custom\_quantization\_int8\_example.py\ provides a complete implementation of INT8 symmetric quantization, including a custom linear layer replacement and quantizer registration. These examples serve as reference implementations for users looking to implement their own quantization methods using the Hugging Face Transformers quantization API.
examples/quantization · high confidence
New modular loss functions for object detection models
The library introduces a new \src/transformers/loss\ package that centralizes loss computation for object detection models. This change adds dedicated loss implementations for D-FINE, Deformable DETR, DEIMv2, Grounding DINO, LW-DETR, and RF-DETR, alongside a shared base module for object detection losses. Users relying on these specific architectures will now have their loss calculations handled by these new, specialized modules, which include features like Matching Aware Loss (MAL) for DEIMv2 and distribution-based bounding box regression for D-FINE.
src/transformers/loss · high confidence
New modular serving layer with OpenAI-compatible endpoints
The \transformers serve\ CLI now uses a new modular serving architecture under \src/transformers/cli/serving\, introducing dedicated handlers for the \/v1/chat/completions\, \/v1/completions\, \/v1/responses\, and \/v1/audio/transcriptions\ endpoints. This update adds support for the OpenAI legacy completions API, the new Responses API (including streaming reasoning content), and audio transcription, while also refactoring model lifecycle management into a dedicated \ModelManager\ that handles caching, auto-unloading, and GGUF-specific logic.
src/transformers/cli/serving · high confidence
New scripts for tokenizer validation and issue stale management
Added \scripts/check\_tokenizers.py\ to validate consistency between slow and fast tokenizer implementations by comparing token IDs on a dataset and reporting discrepancies, and \scripts/stale.py\ to automate GitHub issue lifecycle management by identifying and closing or commenting on issues that have been inactive for specified periods while respecting exemption labels.
scripts · high confidence
New unified export framework for ONNX, ExecuTorch, OpenVINO, and Dynamo
The \src/transformers/exporters\ module introduces a new, unified export system that standardizes how Hugging Face models are converted to deployment formats. This change adds a base \HfExporter\ class and an \AutoHfExporter\ factory that automatically dispatches to the correct backend based on an \export\_format\ field. It provides concrete exporters for ONNX, ExecuTorch, OpenVINO, and TorchDynamo, each with dedicated configuration classes (e.g., \OnnxConfig\, \ExecutorchConfig\) to manage backend-specific settings like opset versions, dynamic shapes, and memory planning. This replaces ad-hoc export logic with a consistent, extensible API for exporting models to various runtime targets.
src/transformers/exporters · high confidence
Port ESMC model to Transformers
Adds the ESMC (Evolutionary Scale Modeling for Chemistry) model to the library, including the configuration, tokenizer, and PyTorch implementation. This port introduces a character-level tokenizer with a fixed 33-token amino acid vocabulary, a configuration class with specific defaults (e.g., 64 vocab size, 2560 hidden size), and a model architecture featuring QK-LayerNorm and Rotary Position Embeddings. A checkpoint conversion script is also provided to transform research checkpoints into the Transformers format.
src/transformers/models/esmc · high confidence
RAG model support is added to the library
The library now includes the Retrieval-Augmented Generation (RAG) model, providing the configuration (\RagConfig\), PyTorch implementation (\RagModel\, \RagSequenceForGeneration\, \RagTokenForGeneration\), tokenizer (\RagTokenizer\), and retrieval components (\RagRetriever\, \LegacyIndex\). This enables users to load, configure, and run RAG models for question answering tasks that combine dense retrieval with generative language models.
src/transformers/models/rag · high confidence
Repository initialization and structural reorganization
The repository has been initialized with a comprehensive set of foundational files, including a new Makefile for managing code quality, testing, and release workflows, and a CITATION.cff file for proper academic attribution. The project structure has been reorganized to support modular development, with the introduction of an .ai directory for agent configurations and a src subdirectory for source code. Additionally, standard governance and contribution documents such as CODE\_OF\_CONDUCT.md, CONTRIBUTING.md, SECURITY.md, and ISSUES.md have been added to guide community participation and ensure security best practices.
(repo-wide) · high confidence
ViLT model support added
The ViLT (Vision-and-Language Transformer) model is now available in the library. This includes the core \ViltModel\ for vision-and-language feature extraction, specialized heads for tasks such as masked language modeling, question answering, image-text retrieval, and classification, as well as a dedicated \ViltProcessor\ that combines text tokenization with image preprocessing. A conversion script is also provided to migrate checkpoints from the original ViLT repository.
(repo-wide) · high confidence
Architecture
CLIP model refactored to v5 modular architecture
The CLIP implementation has been modernized to the library's v5 modular structure, splitting the previously monolithic code into distinct, specialized modules: \configuration\_clip.py\ for configs (now using \PreTrainedConfig\ and \SubConfigSpec\), \modeling\_clip.py\ for the PyTorch model, \image\_processing\_clip.py\ and \image\_processing\_pil\_clip.py\ for separate Torchvision and PIL backends, \processing\_clip.py\ for the processor, and \tokenization\_clip.py\ for the tokenizer. This change introduces lazy loading via \\LazyModule\ in \\\init\\_.py\, standardizes configuration validation with the \@strict\ decorator, and updates the image processor to use the new \TorchvisionBackend\ and \PilBackend\ abstractions.
src/transformers/models/clip · high confidence
Introduce modular Wav2Vec2 implementation with lazy loading
The Wav2Vec2 model files have been restructured into a modular layout under \src/transformers/models/wav2vec2/\, splitting the previous monolithic implementation into distinct files for configuration, feature extraction, tokenization, processing, and the core model logic. This change introduces lazy loading for the Wav2Vec2 module via a \\LazyModule\ in the \\\init\\_.py\ file, which improves import performance by deferring the loading of heavy model components until they are actually used.
src/transformers/models/wav2vec2 · high confidence
Refactor pipelines into a modular package structure
The pipeline system has been reorganized from a single monolithic file into a modular package structure under \src/transformers/pipelines/\. This change introduces separate modules for each pipeline type (e.g., \automatic\_speech\_recognition.py\, \audio\classification.py\, \base.py\), improving code maintainability and separation of concerns. The main \\\init\\_.py\ now serves as the central registry, importing and exposing all pipeline classes and task configurations. Users will see no functional changes, but the internal organization is now more scalable and easier to navigate for contributors.
src/transformers/pipelines · high confidence
Behavioural changes
5397 commits (1314 fixes) modifying src/transformers
A change to existing behaviour in src/transformers — 5397 commits (1314 fixs), 109 files.
src/transformers · medium confidence · unverified
BART model implementation migrated to v5 architecture
The BART model files have been replaced with a new implementation aligned with the library's v5 standards. The model now uses the unified \PreTrainedConfig\ with strict dataclasses, the new \Cache\ object system for past key values, and the standardized attention interface. Tokenization has been simplified by aliasing \BartTokenizer\ and \BartTokenizerFast\ to \RobertaTokenizer\, removing the separate slow/fast implementations.
src/transformers/models/bart · high confidence
BERT model implementation refactored to v5 architecture
The BERT model files in \src/transformers/models/bert\ have been completely rewritten to align with the library's v5 architecture. This change introduces a new \BertConfig\ class using the \@strict\ decorator for validation, replaces the legacy Python tokenizer with a \TokenizersBackend\-based fast tokenizer, and updates the PyTorch model (\modeling\_bert.py\) to use modern patterns such as \nn.Buffer\ for persistent tensors, \GradientCheckpointingLayer\, and the new \Cache\ system for generation. Additionally, conversion scripts for TensorFlow checkpoints have been updated to support the new model structure.
src/transformers/models/bert · high confidence
CamemBERT model and tokenizer are now auto-generated from a modular definition
The CamemBERT implementation has been refactored to use a modular architecture. The core model logic is now defined in \modular\_camembert.py\, which serves as the single source of truth. The standard PyTorch implementation (\modeling\_camembert.py\), configuration (\configuration\_camembert.py\), and tokenizer (\tokenization\_camembert.py\) are now automatically generated from this modular file by the library's build process. This change ensures consistency between the modular and eager implementations and simplifies future maintenance, as updates only need to be applied to the modular source.
src/transformers/models/camembert · high confidence
CircleCI is disabled for the public repository in favor of GitHub Actions
The \.circleci/config.yml\ now detects when the pipeline runs on the public \huggingface/transformers\ repository and switches to a no-op job, effectively disabling CircleCI for that location. This change ensures that CI execution is handled exclusively by GitHub Actions for the main public repository, while private forks and internal repositories continue to use the full CircleCI workflow for test fetching and quality checks.
.circleci · high confidence
DETR model support refactored to use new ImageProcessors and native backbone loading
The DETR model implementation has been updated to use the new \DetrImageProcessor\ (with both Torchvision and PIL backends) instead of the legacy feature extractor, and now supports loading pretrained weights from native Hugging Face ResNet backbones via \load\_backbone\ in addition to the previous timm-based approach. This change also includes updated checkpoint conversion scripts (\convert\_detr\_original\_pytorch\_checkpoint\_to\_pytorch.py\ and \convert\_detr\_to\_pytorch.py\) to handle the new weight structures and config formats, ensuring compatibility with both original Facebook DETR checkpoints and Hugging Face-hosted ResNet backbones.
src/transformers/models/detr · high confidence
DPR model implementation refactored to use lazy imports and modern config validation
The DPR module has been restructured to use lazy imports via \\LazyModule\ in \\\init\\_.py\, improving import performance. The \DPRConfig\ class now inherits from \PreTrainedConfig\ (replacing the deprecated \PretrainedConfig\) and uses the \@strict\ decorator for validated configuration attributes. Additionally, the conversion script \convert\_dpr\_original\_checkpoint\_to\_pytorch.py\ now uses \weights\_only=True\ in \torch.load\ for safer checkpoint loading.
src/transformers/models/dpr · high confidence
DeBERTa model support migrated to modular architecture with fast tokenization
The DeBERTa implementation has been refactored into a modular structure, replacing the previous single-file layout with separate modules for configuration, modeling, and tokenization. This change introduces a fast tokenizer backend (via the \tokenizers\ library) as the primary tokenization method, while removing the legacy slow tokenizer. The model configuration now uses strict validation and auto-generated docstrings, and the modeling code is updated to support modern PyTorch features like gradient checkpointing and ONNX export, ensuring better compatibility with current library standards.
src/transformers/models/deberta · high confidence
Deprecate legacy backbone utility imports and add image normalization constants
The \utils/backbone\_utils.py\ module now emits \FutureWarning\ when \BackboneConfigMixin\ or \BackboneMixin\ are imported from this location, directing users to import them from \transformers.backbone\_utils\ instead ahead of the v5.10 removal. Additionally, \utils/constants.py\ introduces standard image normalization constants (ImageNet and OpenAI CLIP mean/std values) to support image processing pipelines.
src/transformers/utils · high confidence
Encoder-Decoder models now use lazy initialization and unified config handling
The Encoder-Decoder model implementation has been refactored to support lazy module loading, significantly speeding up model initialization on CPU. The configuration system now uses \SubConfigSpec\ to manage encoder and decoder sub-configs, ensuring that changes to the shared config are synced to the underlying models. Additionally, the model now validates that the decoder supports cross-attention and enforces consistency between the encoder's hidden size and the decoder's cross-attention hidden size, raising clear errors if these constraints are violated.
_src/transformers/models/encoder\decoder · high confidence
GPT-NeoX model support is rewritten using the modular architecture
The GPT-NeoX implementation has been completely refactored to use the library's new modular file structure. The model now inherits its core logic from Llama (specifically \LlamaRotaryEmbedding\ and \rotate\_half\), while maintaining GPT-NeoX-specific configuration defaults such as \use\_parallel\_residual\ and \attention\_bias\. The tokenizer has been updated to explicitly handle \add\_bos\_token\ and \add\_eos\_token\ settings by calling \update\_post\_processor()\ to ensure consistency with the backend tokenizer. This change also introduces lazy loading for the module and standardizes the configuration to use \PreTrainedConfig\ with strict validation.
_src/transformers/models/gpt\neox · high confidence
HerBERT tokenizer now uses the fast tokenizers backend
The HerBERT model's tokenizer has been migrated from the legacy slow implementation to the fast tokenizers backend (HuggingFace tokenizers library). This change replaces the previous Python-based tokenization with a Rust-backed implementation, which typically offers significantly faster processing speeds for tokenization tasks. Users relying on \HerbertTokenizer\ will now benefit from this performance improvement while maintaining the same BPE-based tokenization logic and input/output formats.
src/transformers/models/herbert · high confidence
Major refactoring of the generation API and cache system
The \src/transformers/generation\ module has been completely rewritten to introduce a unified \Cache\ abstraction, replacing the legacy \past\_key\_values\ tuple format with dedicated cache classes (e.g., \StaticCache\, \DynamicCache\, \QuantizedCache\). This change standardizes how key-value states are managed during generation, enabling better performance and support for advanced features like continuous batching and speculative decoding. The \GenerationConfig\ now serves as the primary interface for generation parameters, and the \generate\ method delegates cache initialization to the model. Additionally, the module now exports a comprehensive set of candidate generators for assisted decoding, new logits processors (such as \MinPLogitsWarper\ and \WatermarkLogitsProcessor\), and updated streamers, while removing deprecated classes and arguments.
src/transformers/generation · high confidence
Migrate Transformers CLI to Typer
The \transformers\ command-line interface has been rewritten using the Typer framework, replacing the previous implementation. This migration introduces a new, structured CLI with dedicated subcommands for managing models and interacting with services, including \chat\ for interactive model conversations, \serve\ for launching local inference servers with options for continuous batching and quantization, \download\ for fetching models and tokenizers, \add-new-model-like\ for scaffolding new model implementations, and \env\/\version\ for system diagnostics. The new CLI leverages Typer's argument and option parsing for a more consistent user experience.
src/transformers/cli · high confidence
NLLB tokenizer now uses a prefix-based language code pattern by default
The NLLB tokenizer has been updated to use a new default tokenization behavior where the source language code is placed as a prefix before the tokens (e.g., \\<tokens\> \<eos\> \<language code\>\ for source documents). Users who relied on the previous suffix-based pattern (where the language code appeared after the tokens) can restore the old behavior by setting \legacy\_behaviour=True\ when initializing the tokenizer. This change aligns the tokenizer with the standard NLLB input format and improves consistency with the model's expected inputs.
src/transformers/models/nllb · high confidence
RoBERTa model implementation migrated to modular architecture
The RoBERTa model implementation has been refactored to use the library's modular model structure. The core logic now resides in \modular\_roberta.py\, which inherits from BERT components, while \modeling\_roberta.py\ is automatically generated from this modular source. This change introduces support for modern attention backends (SDPA, Flash Attention, Flex Attention) and updates the configuration to use strict validation, ensuring the RoBERTa implementation aligns with the library's new standard for model definitions.
src/transformers/models/roberta · high confidence
XLM-RoBERTa model and config are now independent from RoBERTa
The XLM-RoBERTa implementation has been decoupled from the RoBERTa base classes. The model now uses its own dedicated configuration class (XLMRobertaConfig) and its own PyTorch modeling implementation (XLMRobertaModel, XLMRobertaForMaskedLM, etc.) rather than inheriting from or aliasing the RoBERTa classes. This ensures that changes to the RoBERTa architecture or configuration do not inadvertently affect XLM-RoBERTa, and allows XLM-RoBERTa to maintain its specific defaults (such as its unique vocabulary size and token IDs) independently.
_src/transformers/models/xlm\roberta · high confidence
XLNet model and tokenizer are rewritten for the modern library architecture
The XLNet implementation has been completely refactored to align with the library's current standards. The configuration class now uses dataclasses with the \@strict\ decorator for validation and \@auto\_docstring\ for documentation. The PyTorch modeling code has been updated to use the modern \PreTrainedModel\ base class, \GenerationMixin\, and \ModelOutput\, replacing older patterns. The tokenizer has been migrated to the \TokenizersBackend\ using the Hugging Face \tokenizers\ library (Unigram model) instead of the legacy slow tokenizer, and the module now uses lazy imports via \\_LazyModule\ for faster loading.
src/transformers/models/xlnet · high confidence
Test coverage
5250 commits adding/updating tests in tests; Added distributed GPU diagnostics script.
Dependencies
New benchmark requirements and pyproject.toml configuration
Added requirements files for the benchmark and benchmark\_v2 directories, specifying dependencies such as gpustat, psutil, nvidia-ml-py, torch, datasets, amdsmi, and pyzes. Introduced a pyproject.toml file that consolidates project configuration, including ruff linting rules (enabling checks like RUF013, FURB, SIM, and S110), pytest settings (adding markers for flash attention versions and FSDP), and ty type-checker rules. Also added a requirements file for SageMaker test scripts.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 64 → 62 (-1.7)
Lenses
- Code Health 65 → 64 (-0.0)
- Architecture 87 → 85 (-2.0)
- Maturity 60 → 59 (-1.7)
- Readiness 64 → 60 (-3.6)
- Security 67 → 68 (+1.2)
- Performance 89 → 89 (+0.0)
Resolved (733)
- BitNetDeserialize.convert (cognitive 16) (src/transformers/integrations/bitnet.py)
- Change coupling: modeling_mt5.py ↔ modeling_t5.py (src/transformers/models/mt5/modeling_mt5.py)
- DecompressExperts.convert (cognitive 46) (src/transformers/integrations/compressed_tensors.py)
- DecompressExperts.convert (cyclomatic 21) (src/transformers/integrations/compressed_tensors.py)
- Duplicated block (10 lines × 11) (src/transformers/models/bloom/modeling_bloom.py)
- Duplicated block (10 lines × 14) (src/transformers/models/chameleon/modeling_chameleon.py)
- Duplicated block (10 lines × 2) (examples/pytorch/contrastive-image-text/run_clip.py)
- Duplicated block (10 lines × 2) (examples/pytorch/question-answering/run_qa_beam_search.py)
- Duplicated block (10 lines × 3) (src/transformers/models/idefics2/modeling_idefics2.py)
- Duplicated block (10 lines × 4) (examples/pytorch/summarization/run_summarization_no_trainer.py)
- Duplicated block (10 lines × 5) (src/transformers/models/bloom/modeling_bloom.py)
- Duplicated block (10 lines × 57) (src/transformers/models/afmoe/modular_afmoe.py)
- Duplicated block (10 lines × 9) (examples/pytorch/image-pretraining/run_mim_no_trainer.py)
- Duplicated block (10–11 lines × 15) (examples/pytorch/image-classification/run_image_classification_no_trainer.py)
- Duplicated block (10–11 lines × 2) (examples/pytorch/text-classification/run_xnli.py)
- Duplicated block (10–11 lines × 21) (examples/pytorch/audio-classification/run_audio_classification.py)
- Duplicated block (10–11 lines × 30) (src/transformers/models/blt/modular_blt.py)
- Duplicated block (10–11 lines × 5) (examples/pytorch/image-classification/run_image_classification_no_trainer.py)
- Duplicated block (10–11 lines × 7) (examples/pytorch/language-modeling/run_plm.py)
- Duplicated block (10–12 lines × 2) (src/transformers/models/qwen2_audio/modeling_qwen2_audio.py)
- …and 713 more
New (666)
- Change coupling: modeling_distilbert.py ↔ modeling_gpt_neo.py (src/transformers/models/distilbert/modeling_distilbert.py)
- CompressedTensorsDequantize.convert (cognitive 46) (src/transformers/integrations/compressed_tensors.py)
- CompressedTensorsDequantize.convert (cyclomatic 21) (src/transformers/integrations/compressed_tensors.py)
- DistributedConfig._resolve_parallelism (cognitive 17) (src/transformers/distributed/configuration_utils.py)
- DistributedMixin.init_parallel_plans (cyclomatic 17) (src/transformers/distributed/mixin.py)
- Duplicated block (10 lines × 19) (src/transformers/models/bamba/modular_bamba.py)
- Duplicated block (10 lines × 2) (src/transformers/models/deepseek_vl_hybrid/modular_deepseek_vl_hybrid.py)
- Duplicated block (10 lines × 29) (src/transformers/models/aria/modular_aria.py)
- Duplicated block (10 lines × 29) (src/transformers/models/aria/modular_aria.py)
- Duplicated block (10–11 lines × 2) (src/transformers/models/muse_spark/feature_extraction_muse_spark.py)
- Duplicated block (10–11 lines × 2) (src/transformers/models/nemotron_h_omni/modular_nemotron_h_omni.py)
- Duplicated block (10–11 lines × 31) (src/transformers/models/blt/modular_blt.py)
- Duplicated block (10–11 lines × 5) (src/transformers/models/falcon_mamba/modular_falcon_mamba.py)
- Duplicated block (11 lines × 11) (src/transformers/models/bert_generation/modeling_bert_generation.py)
- Duplicated block (11 lines × 2) (src/transformers/models/moss_transcribe_diarize/modular_moss_transcribe_diarize.py)
- Duplicated block (11 lines × 26) (src/transformers/models/aria/modular_aria.py)
- Duplicated block (11 lines × 3) (src/transformers/models/falcon_h1/modular_falcon_h1.py)
- Duplicated block (11–12 lines × 2) (src/transformers/models/dinov2/modular_dinov2.py)
- Duplicated block (11–13 lines × 2) (src/transformers/models/axk1/modular_axk1.py)
- Duplicated block (11–13 lines × 28) (src/transformers/models/aria/modular_aria.py)
- …and 646 more
Changes since last survey
- 220 commits — 143 feature/other, 77 fixes
By area
- src/transformers — 139 commits
- tests/models — 24 commits
- docs/source — 22 commits
- .github/workflows — 10 commits
- tests/contracts — 3 commits
- tests/repo_utils — 3 commits
- (root) — 2 commits
- docker/transformers-pytorch-xpu — 2 commits
- tests/generation — 2 commits
- tests/quantization — 2 commits
- tests/test_fsdp_mixin.py — 2 commits
- docker/gpu-common — 1 commit
- docker/transformers-intel-cpu — 1 commit
- tests/exporters — 1 commit
- tests/kernels — 1 commit
- tests/tensor_parallel — 1 commit
- tests/test_modeling_common.py — 1 commit
- tests/trainer — 1 commit
- tests/utils — 1 commit
- utils/modular_model_converter.py — 1 commit
Notable commits
- fix: :rotating_light: Fix gemma4 cross imports resulting in import failing without torch but with PIL (#49748)
- fix: Fix BLOOM crash with static cache / compiled generate (#49481)
- fix: Fix CLVP c_proj residual scaled-init silently never applied (#47478)
- fix: Fix CohereCompass text RoPE to use Qwen3-VL interleaved M-RoPE (#49715)
- fix: Fix DeepGEMM Mega MoE under expert parallelism (#49428)
- fix: Fix Fuyu processor test (#49821)
- fix: Fix Gemma3nVision2TextModelTest::test_model_parallelism split (#49562)
- fix: Fix HunYuan-VL image assignment during batched generation (#49557)
- fix: Fix NameError in CI comment workflows: missing section marker variables (#49801)
- fix: Fix PR slow CI suggestion: install transformers in a venv (#49558)
- fix: Fix PR slow CI suggestion: install transformers, fail on script errors (#49549)
- fix: Fix Qwen4-Exp indexer position cache lifecycle (#49840)
- fix: Fix SSH runner: add /opt/venv/bin to PATH for Python 3.11 images (#49759)
- fix: Fix SinglePositionMultiTokenCandidateGenerator signature (#49413)
- fix: Fix SmolVLM inputs_merger when image tokens are not a multiple of patch_size (#49725)
- fix: Fix TPU related tests issues (#49568)
- fix: Fix UnboundLocalError in SuperPoint forward under torch.compile (#49409)
- fix: Fix ValueError when loading a fusion-enabled checkpoint twice (#49412)
- fix: Fix Windows path separators breaking relative imports of Hub custom-generate modules (#48951)
- fix: Fix base_model_prefix in the PP-OCR detectors, CLIPSeg, TimesFM, CLIP and VideoPrism heads so base checkpoints load (#48871)
- …and 200 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
huggingface/transformers was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 25 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 50e35cc0ca18ec19b80653690de553e6decf74f5 — the exact code this score is about.
- Scored under rubric-2026.10.5 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer measure-2026.10.6+preprod-d36780c2d857.