# MNLI Inference on a fine-tuned model from hub

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmnli-inference-on-a-fine-tuned-model-from-hub%2F3948%3E%5C
**Category:** Beginners\
**Created:** [February 24, 2021, 4:12pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmnli-inference-on-a-fine-tuned-model-from-hub%2F3948 "2021-02-24T16:12:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali93H](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Ali93H](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAli93H)%5C
**Post date:** [February 24, 2021, 4:12pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmnli-inference-on-a-fine-tuned-model-from-hub%2F3948%2F1 "2021-02-24T16:12:37Z")

</div>

Hello,  
I tried to run various models such as

- huggingface/distilbert-base-uncased-finetuned-mnli
- microsoft/deberta-v2-xxlarge-mnli
- roberta-large-mnli
- squeezebert/squeezebert-mnli

I can see the weights are loaded but the accuracy I get is about 7%.  
I use “transformers\_version”: “4.3.2”, and the following arguments:

` python run_glue.py --model_name_or_path roberta-large-mnli --task_name mnli --do_eval --max_seq_length 128 --output_dir /tmp/mnli/`

Any help would be appreciated,  
Thank you

---

<div class="post-metadata">

**Author:** ![rgwatwormhill](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rgwatwormhill](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frgwatwormhill)%5C
**Post date:** [February 24, 2021, 7:50pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmnli-inference-on-a-fine-tuned-model-from-hub%2F3948%2F2 "2021-02-24T19:50:34Z")

</div>

Hi Ali93H,

I don’t understand what you are trying to do. Are you wanting to do further fine-tuning (in which case you might want DistilBertForMaskedLM) or to classify your texts for example sentiment analysis (in which case you might want DistilBertForSequenceClassification).

The transformers docs are here [Quick tour — transformers 4.3.0 documentation](https://huggingface.co/transformers/quicktour.html) ,[Summary of the models — transformers 4.3.0 documentation](https://huggingface.co/transformers/model_summary.html#distilbert) , [DistilBERT — transformers 4.3.0 documentation](https://huggingface.co/transformers/model_doc/distilbert.html)

---

<div class="post-metadata">

**Author:** ![Ali93H](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Ali93H](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAli93H)%5C
**Post date:** [February 24, 2021, 8:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmnli-inference-on-a-fine-tuned-model-from-hub%2F3948%2F3 "2021-02-24T20:04:15Z")

</div>

Thanks for your reply. I’m trying to do an evaluation on an already fine-tuned model (reproduce the accuracy metrics).  
If I try this with mrpc or stsb (with fine-tuned models, of course) it works just fine, but I don’t know what is the issue with MNLI.

---

<div class="post-metadata">

**Author:** ![Ali93H](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Ali93H](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAli93H)%5C
**Post date:** [February 25, 2021, 3:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmnli-inference-on-a-fine-tuned-model-from-hub%2F3948%2F4 "2021-02-25T15:57:57Z")

</div>

Here is the source of the issue and a solution: [[run\_glue] Add MNLI compatible mode by JetRunner · Pull Request #10203 · huggingface/transformers · GitHub](https://github.com/huggingface/transformers/pull/10203)
