I’ve just released logfire-callback on PyPI, designed to facilitate monitoring of Hugging Face Transformer training loops using Pydantic Logfire 🤗
text
I’ve just released logfire-callback on PyPI, designed to facilitate monitoring of Hugging Face Transformer training loops using Pydantic Logfire 🤗
new_line
new_line
The callback will automatically log training start with configuration parameters, periodic metrics and training completion ⏱️
text
The callback will automatically log training start with configuration parameters, periodic metrics and training completion ⏱️
new_line
new_line
Install the package using pip:
text
Install the package using pip:
new_line
pip install logfire-callback
bash
```bash
pip install logfire-callback
```
code_fence
new_line
First, ensure you have a Logfire API token and set it as an environment variable:
text
First, ensure you have a Logfire API token and set it as an environment variable:
new_line
export LOGFIRE_TOKEN=your_logfire_token
bash
```bash
export LOGFIRE_TOKEN=your_logfire_token
```
code_fence
new_line
Then use the callback in your training code:
text
Then use the callback in your training code:
new_line
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()
python
```python
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()
```
code_fence
new_line
If you have any feedback, please reach out at 
text
If you have any feedback, please reach out at 
@louisbrulenaudet
mention
louisbrulenaudet
text
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:
```bash
pip install logfire-callback
```
First, ensure you have a Logfire API token and set it as an environment variable:
```bash
export LOGFIRE_TOKEN=your_logfire_token
```
Then use the callback in your training code:
```python
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()
```
If you have any feedback, please reach out at @louisbrulenaudet 
👀
John6666 xinnn63 Takugen dantezxcd