# Different outputs when using pipeline

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifferent-outputs-when-using-pipeline%2F14372%3E%5C
**Category:** Intermediate\
**Created:** [February 3, 2022, 12:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifferent-outputs-when-using-pipeline%2F14372 "2022-02-03T12:05:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack06](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jack06](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJack06)%5C
**Post date:** [February 3, 2022, 12:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifferent-outputs-when-using-pipeline%2F14372%2F1 "2022-02-03T12:05:44Z")

</div>

Hi folks!

I’m currently working on my master thesis and need to implement a text-classification model. Therefore I’m fine-tuning a base BERT model on my data. So far so good. To evaluate my fine-tuned model, I’m passing my test data to it for predictions. For this purpose I’m using the “pipeline” API provided by huggingface with a sigmoid function (since I’m facing a multi-label classification problem). It does work and I get as an output the probs for each class. Now if instead of using the pipeline I tokenize and pass the test data directly to the model (i.e. model(tokenized\_data)) I get the logits for each class back. But if I transform these logits to probs with a sigmoid function, then I get probs which are completely different from the one outputted by the pipeline. Is this somehow possible?

By the way I double-checked everything (tokenized inputs, parameters, model loading etc.). I think I am missing something, but I don’t know what. Any help is pretty much appreciated!!

Thanks in advance!

Jack

---

<div class="post-metadata">

**Author:** ![OskarLiew](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@OskarLiew](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FOskarLiew)%5C
**Post date:** [August 18, 2022, 11:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifferent-outputs-when-using-pipeline%2F14372%2F2 "2022-08-18T11:24:18Z")

</div>

I am facing the same issue that you describe here. Did you figure out what the problem was? I’ve even run the pipeline without activation function and the output is still different from what I get using `trainer.predict`

---

<div class="post-metadata">

**Author:** ![mtyrrell](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@mtyrrell](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmtyrrell)%5C
**Post date:** [July 20, 2023, 10:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdifferent-outputs-when-using-pipeline%2F14372%2F3 "2023-07-20T22:08:54Z")

</div>

I had the same issue. I forgot to include problem\_type in the model config. Added “multi\_label\_classification” and it worked fine.
