-
Notifications
You must be signed in to change notification settings - Fork 69
Integrate SetFit with API Inference + Tests #359
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Dec 1, 2023
osanseviero
approved these changes
Dec 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
Co-authored-by: Omar Sanseviero <[email protected]>
I'll turn this into ==1.0.0 once v1 is actually out.
pcuenca
reviewed
Dec 4, 2023
This may be the case on old models
Narsil
approved these changes
Dec 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
Pull Request overview
docker_images/common
.docker_images/setfit/requirements.txt
,docker_images/setfit/main.py
anddocker_images/setfit/pipelines/token_classification.py
.setfit/tests/test_api.py
with aMiniLM
model for quick tests.tests/test_dockers.py
with a new test fordef test_setfit(self)
.python-api-setfit-cd.yaml
andpython-api-setfit.yaml
)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.
I've used my
tomaarsen/setfit-all-MiniLM-L6-v2-sst2-32-shot
model throughout the tests. This model is based onsentence-transformers/all-MiniLM-L6-v2
embedding model, which should be fairly small (~90MB).To the best of my knowledge, I've followed all of the steps in the README and from the integration documentation. Please let me know if you need anything else from me at this point!
Presumably I don't need to mess around with #158?
Related PRs: