Comment

Comment by brulenaudet

I’ve just released logfire-callback on PyPI, designed to facilitate monitoring of Hugging Face Transformer training loops using Pydantic Logfire

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

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton