    eval_progress_bar = tqdm(dataloader, desc=f"Evaluating Epoch {epoch}", leave=False)
    for batch in eval_progress_bar:
        with torch.no_grad():
            # Forward pass
            outputs = model(**batch)

            losses.append(accelerator.gather_for_metrics(loss.repeat(int(config["eval_batch_size"]))))
            del outputs
    losses = torch.cat(losses)
    try:
        eval_loss = torch.mean(losses)
