# Returning logits from Trainer.predict()

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-logits-from-trainer-predict%2F9314%3E%5C
**Category:** Beginners\
**Created:** [August 18, 2021, 5:27am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-logits-from-trainer-predict%2F9314 "2021-08-18T05:27:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehalit](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ehalit/32/28854_2.png) [@ehalit](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fehalit)%5C
**Post date:** [August 18, 2021, 5:27am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-logits-from-trainer-predict%2F9314%2F1 "2021-08-18T05:27:08Z")

</div>

Hello!

I would like to perform some operations on the output probability distributions of an `AutoModelForSequenceClassification` model so, I was wondering if it is possible to return the logits rather than predicted class labels from the `transformers.Trainer.predict()` method.

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [August 30, 2021, 6:12pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-logits-from-trainer-predict%2F9314%2F2 "2021-08-30T18:12:22Z")

</div>

The predict method does return the logits, as well as the labels.

---

<div class="post-metadata">

**Author:** ![ehalit](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ehalit/32/28854_2.png) [@ehalit](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fehalit)%5C
**Post date:** [August 31, 2021, 4:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-logits-from-trainer-predict%2F9314%2F3 "2021-08-31T04:53:28Z")

</div>

Thank you for the reply, I realized how stupid of a mistake mine was, but I couldn’t delete the post. It surely does return the logits.

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsgugger)%5C
**Post date:** [August 31, 2021, 10:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Freturning-logits-from-trainer-predict%2F9314%2F4 "2021-08-31T10:53:07Z")

</div>

No worries, there are no stupid questions 🙂
