- from torch.utils.tensorboard import SummaryWriter
+ from huggingface_hub import HFSummaryWriter  
import numpy as np  
- writer = SummaryWriter()
+ writer = HFSummaryWriter(repo_id="username/my-trained-model")  
for n_iter in range(100):
writer.add_scalar('Loss/train', np.random.random(), n_iter)
writer.add_scalar('Loss/test', np.random.random(), n_iter)
writer.add_scalar('Accuracy/train', np.random.random(), n_iter)
writer.add_scalar('Accuracy/test', np.random.random(), n_iter)
```