github huggingface/sentence-transformers v5.1.2
v5.1.2 - Sentence Transformers joins Hugging Face; model saving/loading improvements and loss compatibility

22 hours ago

This patch celebrates the transition of Sentence Transformers to Hugging Face, and improves model saving, loading defaults, and loss compatibilities.

Install this version with

# Training + Inference
pip install sentence-transformers[train]==5.1.2

# Inference only, use one of:
pip install sentence-transformers==5.1.2
pip install sentence-transformers[onnx-gpu]==5.1.2
pip install sentence-transformers[onnx]==5.1.2
pip install sentence-transformers[openvino]==5.1.2

Sentence Transformers is joining Hugging Face!

Today, Sentence Transformers is moving from the Ubiquitous Knowledge Processing (UKP) Lab at Technische Universität Darmstadt to Hugging Face. This formalizes the existing maintenance structure, as Tom Aarsen (that's me!) from Hugging Face has been maintaining the project for the past two years. The project's development roadmap, license, support, and commitment to the community remain unchanged. Read the full announcement for more details!

thumbnail

Minor changes re. saving and loading

  • Improve saving models with StaticEmbedding (#3524) and Dense (#3528) modules.
  • Fix training with CPU when "stronger" devices (CUDA, MPS) are available (#3525)
  • Default to 'xpu' device over 'cpu' if the former is available (#3537)

Minor changes re. losses

  • Change errors/warnings for MatryoshkaLoss to prevent easy-to-make mistakes, e.g. forgetting to use the original dimension (#3530)
  • Introduce compatibility between MSELoss and MatryoshkaLoss (#3538)
  • Also use mini-batches for positives with MegaBatchMarginLoss (#3550)

All Changes

New Contributors

Full Changelog: v5.1.1...v5.1.2

Don't miss a new sentence-transformers release

NewReleases is sending notifications on new releases.