v5.1.2
📦 sentence-transformersView on GitHub →
✨ 8 features🐛 9 fixes🔧 9 symbols
Summary
Sentence‑Transformers 5.1.2 adds improved saving for StaticEmbedding and Dense modules, introduces Intel XPU as the default device, enhances loss compatibility, and adds Python 3.13 support while fixing several training and loading bugs.
Migration Steps
- If your code relied on CPU being the default device, verify that it still works when 'xpu' is selected automatically; explicitly set device='cpu' if needed.
- When loading Dense modules saved in fp32, you can now load them in other precisions without error.
- Review any custom loss handling for MatryoshkaLoss; the new dimension checks may raise warnings for mismatched shapes.
- Ensure your environment has the appropriate Intel XPU runtime installed to take advantage of the new default device.
- Test your code with Python\u00a03.13 if you plan to upgrade, as new support has been added.
✨ New Features
- Improved model saving for StaticEmbedding modules.
- Improved model saving for Dense modules.
- Default device selection now prefers Intel 'xpu' over 'cpu' when available.
- Added bounds checks and warnings for MatryoshkaLoss dimensions.
- Introduced compatibility between MSELoss and MatryoshkaLoss.
- MegaBatchMarginLoss now uses mini‑batches for positive samples.
- Added support for Python\u00a03.13.
- Added Intel 'xpu' device support in environment handling.
🐛 Bug Fixes
- Fixed static model saving failure due to non‑contiguous weights.
- Fixed trainer state bug affecting training.
- Patched Router training to work with cached losses.
- Allowed loading Dense modules saved in non‑fp32 precision.
- Adjusted test regex expectations for Python\u00a03.9.
- Corrected typo \"inaccuracte\" to \"inaccurate\".
- Fixed dataset link in training scripts.
- Enabled MatryoshkaLoss to be used together with MSELoss.
- Updated markdown formatting across documentation.
🔧 Affected Symbols
StaticEmbeddingDenseenvironmentMatryoshkaLossMSELossMegaBatchMarginLossTrainerRouterRegex