You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Train via the Sentence Transformers Trainer from ST v3 (#554)
* Train via the Sentence Transformers Trainer from ST v3
* Simplify some init code; docstring
* Prevent breaking changes by updating TrainerCallback
* Replace ST Training Args with SetFit Training Args
* Remove unused properties
* Require 'accelerate' when training SetFit models
* Remove log in docs as it is no longer used
* Fix docs issue
* Require installing sentence-transformers[train]
* Keep not having to override metric_for_best_model by default
It'll just keep using the loss of whatever trainer you're using.
* Ensure logs directory is made in Callbacks example
* Fix outdated docstring
Copy file name to clipboardExpand all lines: docs/source/en/how_to/callbacks.mdx
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,11 +59,15 @@ trainer.train()
59
59
SetFit supports custom callbacks in the same way that `transformers` does: by subclassing [`TrainerCallback`](https://huggingface.co/docs/transformers/main_classes/callback#transformers.TrainerCallback). This class implements a lot of `on_...` methods that can be overridden. For example, the following script shows a custom callback that saves plots of the tSNE of the training and evaluation embeddings during training.
60
60
61
61
```py
62
+
import os
62
63
import matplotlib.pyplot as plt
63
64
from sklearn.manifold importTSNE
64
65
65
66
classEmbeddingPlotCallback(TrainerCallback):
66
67
"""Simple embedding plotting callback that plots the tSNE of the training and evaluation datasets throughout training."""
0 commit comments