# Where did eval\_preds in compute\_metrics function come from?

**URL:** <https://discuss.huggingface.co/t/where-did-eval-preds-in-compute-metrics-function-come-from/35292>\
**Category:** 🤗 Course Projects\
**Created:** [April 2, 2023, 3:38am UTC](https://discuss.huggingface.co/t/where-did-eval-preds-in-compute-metrics-function-come-from/35292 "2023-04-02T03:38:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soujanna](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@soujanna](https://discuss.huggingface.co/u/soujanna)\
**Post date:** [April 2, 2023, 3:38am UTC](https://discuss.huggingface.co/t/where-did-eval-preds-in-compute-metrics-function-come-from/35292/1 "2023-04-02T03:38:04Z")

</div>

In Chapter 3 of the Huggingface NLP course, Section Fine Tuning a Model with the Trainer API, I see this concise function, which calls eval\_preds:

def compute\_metrics(eval\_preds):  
metric = evaluate.load(“glue”, “mrpc”)  
logits, labels = **eval\_preds**  
predictions = np.argmax(logits, axis=-1)  
return metric.compute(predictions=predictions, references=labels)

I can possibly guess what this is doing, but is this an object that becomes automatically available during training? It would definitely help to update the material explaining this.

Thanks for the awesome course.
