# Custom model for Trainer

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcustom-model-for-trainer%2F45921%3E%5C
**Category:** 🤗Transformers\
**Created:** [July 6, 2023, 3:42pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcustom-model-for-trainer%2F45921 "2023-07-06T15:42:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oran-sh](https://avatars.discourse-cdn.com/v4/letter/o/a4c791/32.png) [@oran-sh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Foran-sh)%5C
**Post date:** [July 6, 2023, 3:42pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcustom-model-for-trainer%2F45921%2F1 "2023-07-06T15:42:27Z")

</div>

Hello,  
trying to figure out everything needed when I train a custom model with trainer.

1. As far as I understand - output should be tuple with loss value first.
2. the function provided to compute\_metrics takes EvalPrediction. How is the value passed to my compute metrics function created? How does trainer know how to build the input to this compute\_metrics function

Thanks!

---

<div class="post-metadata">

**Author:** ![oran-sh](https://avatars.discourse-cdn.com/v4/letter/o/a4c791/32.png) [@oran-sh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Foran-sh)%5C
**Post date:** [July 8, 2023, 8:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcustom-model-for-trainer%2F45921%2F2 "2023-07-08T20:02:22Z")

</div>

Up. Any answer for this? 😊
