huggingface / setfit

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

Train via the Sentence Transformers Trainer from ST v3 #554

Closed tomaarsen closed 2 months ago

tomaarsen commented 2 months ago

Hello!

Pull Request overview

Details

In v1 of SetFit, I moved from the old model.fit training from Sentence Transformers (as it didn't have e.g. loss logging, etc.) to a custom training loop that does. However, since then, Sentence Transformers v3 has released, which also added all of the features that were previously lacking. To simplify the training moving forward, the training is now (once again) deferred to Sentence Transformers.

Because both the old and new training approach are based on the transformers Trainer, we don't need to make a lot of changes. I've worked to try and prevent breaking changes, e.g. updating the Sentence Transformers callbacks such that it still returns a SetFitModel like before.

HuggingFaceDocBuilderDev commented 2 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.