# Trainer API showing loss = 0 after first log

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-api-showing-loss-0-after-first-log%2F90575%3E%5C
**Category:** 🤗Transformers\
**Created:** [June 6, 2024, 12:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-api-showing-loss-0-after-first-log%2F90575 "2024-06-06T00:15:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![not-lain](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/not-lain/32/59092_2.png) [@not-lain](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnot-lain)%5C
**Post date:** [June 6, 2024, 12:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftrainer-api-showing-loss-0-after-first-log%2F90575%2F1 "2024-06-06T00:15:05Z")

</div>

I am trying to make a custom AI model compatible with the trainer API and it seems that the loss is acting in an expected behaviour, there is no error or anything, just this one :

 ![logs](https://us1.discourse-cdn.com/hellohellohello/original/3X/6/d/6d23953d51d47c8991fe926f8d297c8159f892b5.png)

Code is pretty long to paste here so I uploaded a copy here :

> **[Google Colab](https://colab.research.google.com/drive/1_IenbmaMylGDkGMKeF03XR41S2OP3spn?usp=sharing)**

If any ideas why this is happeninig ?
