A simple package to add a new parameter for the SentenceTransformer class
Project description
Callbackable Sentence Transformers
A simple class to replace the SentenceTransformer
class from sentence_transformers package.
It adds a simple parameter callback_during_training
to the SentenceTransformer.fit()
function be able to get the loss value of the SentenceTransformer during training.
from callbackable_sentence_transformers import CallbackableSentenceTransformer
model = CallbackableSentenceTransformer(model_checkpoint)
def callback(loss, epoch, step):
print(f"Loss at epoch {epoch}, {step}: {loss}")
model.fit(..., callback_during_training=callback)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file callbackable_sentence_transformers-2024.0.0.tar.gz
.
File metadata
- Download URL: callbackable_sentence_transformers-2024.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
aa345f995bc24f97af93516853004d9dcc47445339e41af62b9e88d91e4312b9
|
|
MD5 |
a8943b39f955e98a2fcf8bd6dc814cae
|
|
BLAKE2b-256 |
a29b01b6523fa754bc9e9330740f05a305d08721b8b91c7968c5845cdc6bfd69
|
File details
Details for the file callbackable_sentence_transformers-2024.0.0-py3-none-any.whl
.
File metadata
- Download URL: callbackable_sentence_transformers-2024.0.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5f9790236ee66a31ee4d3c31b882252c133be91cc56e7376a3758e670318a10c
|
|
MD5 |
abf671d5a786441568dfb07be5ebd703
|
|
BLAKE2b-256 |
6149e185c55be6b6eeb66d1a4dc12453a31bb6a0adba3b2e7f16986f321d2e56
|