# Cannot replicate xlm-roberta-large-xnli Results

**URL:** <https://discuss.huggingface.co/t/cannot-replicate-xlm-roberta-large-xnli-results/9685>\
**Category:** Models\
**Created:** [September 2, 2021, 7:58am UTC](https://discuss.huggingface.co/t/cannot-replicate-xlm-roberta-large-xnli-results/9685 "2021-09-02T07:58:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stip](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Stip](https://discuss.huggingface.co/u/Stip)\
**Post date:** [September 2, 2021, 7:58am UTC](https://discuss.huggingface.co/t/cannot-replicate-xlm-roberta-large-xnli-results/9685/1 "2021-09-02T07:58:05Z")

</div>

Hi guys! First of all, i’d like to thank you regarding your hard work you do for us all.

But here’s the issue:  
I’m trying to replicate results of the xlm-roberta-large-xnli model of joeddav, obtained within the [HuggingFace Model Page](https://huggingface.co/joeddav/xlm-roberta-large-xnli), but it seems impossible: values i get through my python code are always different from the above-mentioned ones. I also tried [his notebook](https://colab.research.google.com/drive/1jocViLorbwWIkTXKwxCOV9HLTaDDgCaw?usp=sharing), but they’re different too.

It’s not worth mentioning the specific Sentence and Labels, since ANY string and labels, in any language, i tried, got different results from that page.

I even tried to use `hypotesis_template` which increased the values difference even more.

Here’s the code i used:

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline
import torch

device = 0 if torch.cuda.is_available() else -1
tokenizer = AutoTokenizer.from_pretrained("joeddav/xlm-roberta-large-xnli")

model = AutoModelForSequenceClassification.from_pretrained("joeddav/xlm-roberta-large-xnli")

sequence_to_classify = "Con la mia macchina del caffe e la capsula prima esce solo acqua, poi si sente che la capsula viene bucata e infine esce il caffè. Ma intanto l' acqua è nella tazzina. Voglio un rimborso per tutti i soldi che ho speso."
candidate_labels = ["tecnologia", "cibo", "bevande", "finanza", "cinema", "giochi"]

classifier = pipeline("zero-shot-classification",
                      model=model, tokenizer=tokenizer, device=device)

#hypothesis_template = "This text is about {}."
classifier(sequence_to_classify, candidate_labels, hypothesis_template, multi_class=False)

```
