Content-Length: 377397 | pFad | https://github.com/huggingface/hub-docs/pull/1150

C6 Integrate SetFit library by tomaarsen · Pull Request #1150 · huggingface/hub-docs · GitHub
Skip to content

Integrate SetFit library #1150

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
merged 4 commits into from
Dec 5, 2023
Merged

Conversation

tomaarsen
Copy link
Member

@tomaarsen tomaarsen commented Dec 1, 2023

Hello!

Pull Request overview

  • Integrate with the SetFit library for Text Classification.

Details

SetFit is a library for text classification with ~1200 models on the Hub at the time of writing. A v1.0.0 release is upcoming, and it's a good time to add this widget support, etc. It can be used like so:

from setfit import SetFitModel

model = SetFitModel.from_pretrained("tomaarsen/span-marker-bert-base-fewnerd-fine-super")
model.predict(["That was an awful movie"])
# => ["negative"]

I've followed the documentation here, but it seems to be a bit outdated compared to the last time that I added an integration. It still mentions to edit model-libraries.ts with a snippet like

const asteroid = (model: ModelData) =>
`from asteroid.models import BaseModel
  
model = BaseModel.from_pretrained("${model.id}")`;

But that type of data isn't in that file anymore. (cc: @coyotte508 ?)
Presumably I also have to update that in huggingface.js?

Note: Some of the links, e.g. https://huggingface.co/docs/setfit/reference/main#setfit.SetFitModel.predict, do not currently work, but will start working when SetFit v1.0.0 releases next week.

Related PRs:

  • Tom Aarsen

Copy link
Contributor

@merveenoyan merveenoyan left a comment

Choose a reason for hiding this comment

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

Thank you 🤗

tomaarsen and others added 2 commits December 1, 2023 17:23
Co-authored-by: Merve Noyan <merveenoyan@gmail.com>
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

coyotte508 added a commit that referenced this pull request Dec 1, 2023
See #1150 / comment in #1151

Not sure at all where to add it, added at the end
osanseviero pushed a commit that referenced this pull request Dec 1, 2023
See #1150 / comment in #1151

Not sure at all where to add it, added at the end
Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Very nice!

Thanks @pcuenca :)

Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
@osanseviero osanseviero merged commit c65d133 into huggingface:main Dec 5, 2023
osanseviero pushed a commit to huggingface/huggingface.js that referenced this pull request Dec 5, 2023
Hello!

## Pull Request overview
* Integrate with the [SetFit](https://github.com/huggingface/setfit)
library for Text Classification.

## Details
[SetFit](https://github.com/huggingface/setfit) is a library for text
classification with ~1200 models on the Hub at the time of writing. A
v1.0.0 release is upcoming, and it's a good time to add this widget
support, etc. It can be used like so:
```python
from setfit import SetFitModel

model = SetFitModel.from_pretrained("tomaarsen/span-marker-bert-base-fewnerd-fine-super")
```
```
model.predict(["That was an awful movie"])
# => ["negative"]
```
I've previously integrated a library by only editing hub-docs and
api-inference-community, but I see that there's been some refactors
since. I hope that with these changes, I've edited the correct places. I
also noticed this file:
https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/library-to-tasks.ts#L36,
but it seems that it's automatically updated. So, I didn't touch that
one.

Let me know if there's any more changes needed!

Related PRs: 
* huggingface/api-inference-community#359
* huggingface/hub-docs#1150

- Tom Aarsen
@tomaarsen tomaarsen deleted the integration/setfit branch December 5, 2023 22:39
etronhatton pushed a commit to etronhatton/huggingface that referenced this pull request May 11, 2025
Hello!

## Pull Request overview
* Integrate with the [SetFit](https://github.com/huggingface/setfit)
library for Text Classification.

## Details
[SetFit](https://github.com/huggingface/setfit) is a library for text
classification with ~1200 models on the Hub at the time of writing. A
v1.0.0 release is upcoming, and it's a good time to add this widget
support, etc. It can be used like so:
```python
from setfit import SetFitModel

model = SetFitModel.from_pretrained("tomaarsen/span-marker-bert-base-fewnerd-fine-super")
```
```
model.predict(["That was an awful movie"])
# => ["negative"]
```
I've previously integrated a library by only editing hub-docs and
api-inference-community, but I see that there's been some refactors
since. I hope that with these changes, I've edited the correct places. I
also noticed this file:
https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/library-to-tasks.ts#L36,
but it seems that it's automatically updated. So, I didn't touch that
one.

Let me know if there's any more changes needed!

Related PRs: 
* huggingface/api-inference-community#359
* huggingface/hub-docs#1150

- 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.

5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/huggingface/hub-docs/pull/1150

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy