| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2025-10-22 | 4.9 kB | |
| v5.1.2 - Sentence Transformers joins Hugging Face_ model saving_loading improvements and loss compatibility source code.tar.gz | 2025-10-22 | 13.3 MB | |
| v5.1.2 - Sentence Transformers joins Hugging Face_ model saving_loading improvements and loss compatibility source code.zip | 2025-10-22 | 13.8 MB | |
| Totals: 3 Items | 27.0 MB | 1 | |
This patch celebrates the transition of Sentence Transformers to Hugging Face, and improves model saving, loading defaults, and loss compatibilities.
Install this version with
:::bash
# 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!
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
- fix: static model saving fails because weights are not contiguous by @stephantul in https://github.com/UKPLab/sentence-transformers/pull/3524
- bug: fix state bug in trainer by @stephantul in https://github.com/UKPLab/sentence-transformers/pull/3525
- [
fix] Patch Router training with Cached losses by @tomaarsen in https://github.com/UKPLab/sentence-transformers/pull/3527 - [
fix] Allow loading Dense modules not saved in fp32 by @tomaarsen in https://github.com/UKPLab/sentence-transformers/pull/3528 - [
tests] Patch Regex expected output for Python 3.9 by @tomaarsen in https://github.com/UKPLab/sentence-transformers/pull/3529 - Future-proof tests for upcoming transformers version by @tomaarsen in https://github.com/UKPLab/sentence-transformers/pull/3533
- feat: matryoshka dims bounds checks and warning by @stephantul in https://github.com/UKPLab/sentence-transformers/pull/3530
- Performance table format and Few markdownlint error correction by @kaushikacharya in https://github.com/UKPLab/sentence-transformers/pull/3534
- fix typos: inaccuracte -> inaccurate by @whybe-choi in https://github.com/UKPLab/sentence-transformers/pull/3542
- [
fix] correct dataset link in training scripts by @thomasht86 in https://github.com/UKPLab/sentence-transformers/pull/3543 - [
fix] Allow MatryoshkaLoss with MSELoss by @tomaarsen in https://github.com/UKPLab/sentence-transformers/pull/3538 - [
docs] Format all markdown using mdformat by @tomaarsen in https://github.com/UKPLab/sentence-transformers/pull/3539 - feat: provide support for python 3.13 by @lordoffreaks in https://github.com/UKPLab/sentence-transformers/pull/3551
- Update MTEB docs to v2 by @KennethEnevoldsen in https://github.com/UKPLab/sentence-transformers/pull/3548
- Add support for Intel 'xpu' device in environment.py by @domschl in https://github.com/UKPLab/sentence-transformers/pull/3537
- docs: Update project metadata by @tomaarsen in https://github.com/huggingface/sentence-transformers/pull/3553
- MegaBatchMarginLoss use mini batches for positives too by @benHeid in https://github.com/huggingface/sentence-transformers/pull/3550
New Contributors
- @kaushikacharya made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3534
- @whybe-choi made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3542
- @thomasht86 made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3543
- @lordoffreaks made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3551
- @KennethEnevoldsen made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3548
- @domschl made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3537
- @benHeid made their first contribution in https://github.com/UKPLab/sentence-transformers/pull/3550
Full Changelog: https://github.com/UKPLab/sentence-transformers/compare/v5.1.1...v5.1.2