huggingface / setfit

Efficient few-shot learning with Sentence Transformers
https://hf.co/docs/setfit
Apache License 2.0
2.25k stars 223 forks source link

Prepare SetFit for upcoming 2.3.0 release of SentenceTransformers #463

Closed tomaarsen closed 10 months ago

tomaarsen commented 11 months ago

Hello!

Pull Request overview

Details

Note: Sentence Transformers 2.3.0 will be backwards compatible, and not having these changes in your SetFit install just means that you get a warning that you won't get with these changes.

In short, Sentence Transformers 2.3.0 will fix the currently broken model_body.device, allowing us to actually use that one again instead of the hacky model_body._target_device.

We also add trust_remote_code, mirroring the upcoming support for Sentence Transformers. This PR also stores the loading kwargs from Sentence Transformers into the model, so that we can correctly load the best checkpoint (even if that requires trust_remote_code=True for example)


cc @bwanglzu If you're interested, this PR should allow Jina embeddings to be used for efficient text classification models :)

HuggingFaceDocBuilderDev commented 11 months ago

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.