in training/flax/run_finetuning.py [0:0]
def write_wandb_pred(wandb_logger, pred_str, label_str, prefix="eval", num_lines=100):
# convert str data to a wandb compatible format
if num_lines < len(pred_str):
str_data = [[label_str[i], pred_str[i]] for i in range(num_lines)]
else:
str_data = [[label_str[i], pred_str[i]] for i in range(len(pred_str))]
# log as a table with the appropriate headers
wandb_logger.log(
{f"{prefix}/predictions": wandb_logger.Table(columns=["label_str", "pred_str"], data=str_data)},
)