Skip to content
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

Add CrossEncoder to the Sentence Transformers "How to Use" snippet & patch SetFit #1337

Merged
merged 3 commits into from
Apr 8, 2025

Conversation

tomaarsen
Copy link
Member

Hello!

Pull Request overview

  • Add CrossEncoder to the Sentence Transformers "How to Use" snippet
  • Patch "How to Use" for SetFit models (that are also tagged as Sentence Transformers)

Details

This PR adds the CrossEncoder class to the "How to Use" snippets. I'm working on feature parity of these models with the more common SentenceTransformer models, and the recent Sentence Transformers v4.0 release was a big step in that.
We're already at 150 models: https://huggingface.co/models?pipeline_tag=text-ranking&library=sentence-transformers

Beyond that, this ensures that [widgetExample.source_sentence, ...widgetExample.sentences] doesn't crash, apparently that currently happens for some SetFit models, e.g.: https://huggingface.co/faodl/setfit-paraphrase-mpnet-base-v2-5ClassesDesc-multilabel-augmented?library=sentence-transformers

  • Tom Aarsen

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm from a superficial glance at the code, but also cc @Wauplin 😁

@tomaarsen
Copy link
Member Author

@Wauplin could you have a quick look at this? 🤗 Would like to get this out soon.

  • Tom Aarsen

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Wauplin Wauplin merged commit 02ce8cb into huggingface:main Apr 8, 2025
4 checks passed
@Wauplin
Copy link
Contributor

Wauplin commented Apr 8, 2025

@tomaarsen I merged the PR and made a release of @huggingface/tasks. It should arrive in moon-landing by tomorrow by the dependabot (you can open a PR if you want to fast-track it).

@tomaarsen
Copy link
Member Author

Thanks @Wauplin! I'll let the dependabot take care of it. I appreciate it!

  • Tom Aarsen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants