Replace the embedding finetuning training methods with the Sentence Transformers v3 Trainer
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 transformersTrainer, 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.
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.
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.