Content-Length: 363854 | pFad | https://github.com/huggingface/huggingface.js/pull/387

57 🧱 Integrate SetFit library by tomaarsen · Pull Request #387 · huggingface/huggingface.js · GitHub
Skip to content

🧱 Integrate SetFit library #387

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 2 commits into from
Dec 5, 2023

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

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

Thanks Tom!

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

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

LGTM!

Let's please add to https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/library-to-tasks.ts#L36 in this PR. This is automatically generated when merging a PR in the community repo (such as huggingface/api-inference-community#359), so you would still need to add a PR later on

@tomaarsen
Copy link
Member Author

@osanseviero So I should update that file (manually)? I figured I shouldn't touch it as it's automatically generated.

@osanseviero
Copy link
Contributor

Yes. At the moment the file is actually not generated automatically. The mapping is generated automatically (see https://github.com/huggingface/api-inference-community/actions/runs/7057881147/job/19212375912), but the file is then updated manually.

@tomaarsen
Copy link
Member Author

tomaarsen commented Dec 4, 2023

I see, I see! I'll get on it. Edit: Done.

@tomaarsen
Copy link
Member Author

Do I need to concern myself with the linting/test failure? I'd like to get this & huggingface/hub-docs#1150 merged tomorrow.

@pcuenca
Copy link
Member

pcuenca commented Dec 5, 2023

@tomaarsen I launched a new run, seeing that this was merged earlier: #392

@tomaarsen
Copy link
Member Author

Awesome! Looks like it worked

@osanseviero osanseviero merged commit 028c95a into huggingface:main Dec 5, 2023
@tomaarsen
Copy link
Member Author

Thanks @osanseviero, @pcuenca & @merveenoyan for the reviews on these PRs!

@tomaarsen tomaarsen deleted the integration/setfit branch December 5, 2023 22:39
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








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/huggingface.js/pull/387

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy