Skip to content

Python: Update sentence-transformers requirement from <5.0,>=2.2 to >=2.2,<6.0 in /python #12679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 8, 2025

Updates the requirements on sentence-transformers to permit the latest version.

Release notes

Sourced from sentence-transformers's releases.

v5.0.0 - SparseEncoder support; encode_query & encode_document; multi-processing in encode; Router; and more

This release consists of significant updates including the introduction of Sparse Encoder models, new methods encode_query and encode_document, multi-processing support in encode, the Router module for asymmetric models, custom learning rates for parameter groups, composite loss logging, and various small improvements and bug fixes.

Install this version with

# Training + Inference
pip install sentence-transformers[train]==5.0.0
Inference only, use one of:
pip install sentence-transformers==5.0.0
pip install sentence-transformers[onnx-gpu]==5.0.0
pip install sentence-transformers[onnx]==5.0.0
pip install sentence-transformers[openvino]==5.0.0

[!TIP] Our Training and Finetuning Sparse Embedding Models with Sentence Transformers v5 blogpost is an excellent place to learn about finetuning sparse embedding models!

[!NOTE] This release is designed to be fully backwards compatible, meaning that you should be able to upgrade from older versions to v5.x without any issues. If you are running into issues when upgrading, feel free to open an issue. Also see the Migration Guide for changes that we would recommend.

Sparse Encoder models

The Sentence Transformers v5.0 release introduces Sparse Embedding models, also known as Sparse Encoders. These models generate high-dimensional embeddings, often with 30,000+ dimensions, where often only <1% of dimensions are non-zero. This is in contrast to the standard dense embedding models, which produce low-dimensional embeddings (e.g., 384, 768, or 1024 dimensions) where all values are non-zero.

Usually, each active dimension (i.e. the dimension with a non-zero value) in a sparse embedding corresponds to a specific token in the model's vocabulary, allowing for interpretability. This means that you can e.g. see exactly which words/tokens are important in an embedding, and that you can inspect exactly because of which words/tokens two texts are deemed similar.

Let's have a look at naver/splade-v3, a strong sparse embedding model, as an example:

from sentence_transformers import SparseEncoder
Download from the 🤗 Hub
model = SparseEncoder("naver/splade-v3")
Run inference
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
(3, 30522)
Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
tensor([[   32.4323,     5.8528,     0.0258],
</tr></table>

... (truncated)

Commits
  • 8dc0fca Release v5.0.0
  • e91af6a Update links for SPLADE and Inference-Free SPLADE models collections in docum...
  • 4c00aea [fix] Remove hub_kwargs in SparseStaticEmbedding.from_json in favor of more...
  • 28685bb Clean up gitignore (#3409)
  • 85dd175 Fix formatting of docstring arguments in SpladeRegularizerWeightSchedulerCall...
  • 14afc4b Merge PR #3401: [v5] Add support for Sparse Embedding models
  • 2d24841 Update tip phrasing and fix links
  • ed043c5 typo
  • b2679d1 fix broken link
  • d30341e Update tips to prepared for v5.0
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [sentence-transformers](https://github.com/UKPLab/sentence-transformers) to permit the latest version.
- [Release notes](https://github.com/UKPLab/sentence-transformers/releases)
- [Commits](UKPLab/sentence-transformers@v2.2.0...v5.0.0)

---
updated-dependencies:
- dependency-name: sentence-transformers
  dependency-version: 5.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file. Used by Dependabot. python Pull requests for the Python Semantic Kernel labels Jul 8, 2025
@dependabot dependabot bot requested a review from a team as a code owner July 8, 2025 01:29
@dependabot dependabot bot added dependencies Pull requests that update a dependency file. Used by Dependabot. python Pull requests for the Python Semantic Kernel labels Jul 8, 2025
@github-actions github-actions bot changed the title Update sentence-transformers requirement from <5.0,>=2.2 to >=2.2,<6.0 in /python Python: Update sentence-transformers requirement from <5.0,>=2.2 to >=2.2,<6.0 in /python Jul 8, 2025
@moonbox3 moonbox3 enabled auto-merge July 15, 2025 08:30
@moonbox3 moonbox3 added this pull request to the merge queue Jul 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 15, 2025
@moonbox3 moonbox3 added this pull request to the merge queue Jul 17, 2025
Merged via the queue into main with commit d96cadc Jul 17, 2025
27 checks passed
@moonbox3 moonbox3 deleted the dependabot/pip/python/sentence-transformers-gte-2.2-and-lt-6.0 branch July 17, 2025 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file. Used by Dependabot. python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants