Hello,
Coming from tensorflow
I am a bit confused as to how to properly define the compute_metrics() in Trainer. For instance, I see in the notebooks various possibilities
def compute_metrics(eval_pred):
predictions, labels = eval_pred
predictions = predictions[:, 0]
return metric.compute(predictions=predictions, references=labels)
My question may seem stupid (maybe it is) but how can I know how to compute the metrics if I cannot see what eval_pred
looks like in Trainer? It is as if I had to guess what the output will be before actually training the model. Am I missing something here?
Thanks!