# Model results differ after creating pipeline with same model

**URL:** <https://discuss.huggingface.co/t/model-results-differ-after-creating-pipeline-with-same-model/1315>\
**Category:** Beginners\
**Created:** [September 30, 2020, 1:22pm UTC](https://discuss.huggingface.co/t/model-results-differ-after-creating-pipeline-with-same-model/1315 "2020-09-30T13:22:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayanksatnalika](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mayanksatnalika/32/344_2.png) [@mayanksatnalika](https://discuss.huggingface.co/u/mayanksatnalika)\
**Post date:** [September 30, 2020, 1:22pm UTC](https://discuss.huggingface.co/t/model-results-differ-after-creating-pipeline-with-same-model/1315/1 "2020-09-30T13:22:44Z")

</div>

Im using a pre-trained tokeniser and a fine-tuned model.  
With the same model, when I create pipeline, my results differ both the time.

```nohighlight
tokenizer = AutoTokenizer.from_pretrained("huggingface/CodeBERTa-small-v1")
mymodelclf = TextClassificationPipeline(model=model, tokenizer = tokenizer,return_all_scores = True )
print (mymodelclf( negative_samples ) ) 

```

The same code is run twice, but 2 different results are obtained. Is this expected?

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/1/161a22780b9c379067336a5228897a6cd4b23629.png)

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [September 30, 2020, 1:54pm UTC](https://discuss.huggingface.co/t/model-results-differ-after-creating-pipeline-with-same-model/1315/2 "2020-09-30T13:54:36Z")

</div>

Are you sure your model is in evaluation mode?

---

<div class="post-metadata">

**Author:** ![mayanksatnalika](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mayanksatnalika/32/344_2.png) [@mayanksatnalika](https://discuss.huggingface.co/u/mayanksatnalika)\
**Post date:** [September 30, 2020, 1:57pm UTC](https://discuss.huggingface.co/t/model-results-differ-after-creating-pipeline-with-same-model/1315/3 "2020-09-30T13:57:35Z")

</div>

Oh thank you. Apologies I did not look into the examples well enough and did not set eval mode.  
A google search shows that eval mode is necessary for reproducible results.  
Im getting the expected results now. Thank you very much for the quick help.
