by brulenaudet · 1y ago · 0 comments
The callback will automatically log training start with configuration parameters, periodic metrics and training completion
Install the package using pip:
pip install logfire-callback
First, ensure you have a Logfire API token and set it as an environment variable:
export LOGFIRE_TOKEN=your_logfire_token
Then use the callback in your training code:
from transformers import Trainer, TrainingArguments from logfire_callback import LogfireCallback
# Initialize your model, dataset, etc.
training_args = TrainingArguments( output_dir="./results", num_train_epochs=3, # ... other training arguments )
trainer = Trainer( model=model, args=training_args, train_dataset=train_dataset, callbacks=[LogfireCallback()] # Add the Logfire callback here )
trainer.train()
No comments yet.