examples/research_projects/codeparrot/scripts/codeparrot_training.py/log_metrics
def log_metrics(step, metrics):
    logger.info(f"Step {step}: {metrics}")
    if accelerator.is_main_process:
        accelerator.log(metrics, step)