Overview

Transformers 4.50, released on March 15, 2025, adds support for the latest models and improves multi-framework compatibility.

Main Features

New models

New models are natively integrated, including the latest architectures from the open-source community.

python
from transformers import AutoTokenizer, AutoModel

# Load a recent model
tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')
model = AutoModel.from_pretrained('bert-base-uncased')

inputs = tokenizer('Hello world', return_tensors='pt')
outputs = model(**inputs)
print(f'Hidden size: {outputs.last_hidden_state.shape}')

Multi-framework compatibility

JAX, PyTorch, and TensorFlow support is improved with more reliable weight conversions between frameworks.

python
from transformers import AutoModel

# Load in PyTorch
model_pt = AutoModel.from_pretrained('bert-base-uncased')

# Save and reload in TensorFlow
model_pt.save_pretrained('./model')
# from transformers import TFAutoModel
# model_tf = TFAutoModel.from_pretrained('./model', from_pt=True)

Sources