# Fine-tuning Zero-shot models

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338%3E%5C
**Category:** Intermediate\
**Created:** [March 4, 2022, 8:28am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338 "2022-03-04T08:28:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShieldHero](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shieldhero/32/4451_2.png) [@ShieldHero](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FShieldHero)%5C
**Post date:** [March 4, 2022, 8:28am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338%2F1 "2022-03-04T08:28:31Z")

</div>

I am using [facebook/bart-large-mnli](https://huggingface.co/facebook/bart-large-mnli) for my text classification task. The labels used during inference would be a subset of a list of labels. So, i want to fine-tune the model on a custom dataset with ~1000 examples.

I understand that @joeddav has explained it in this [comment](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fnew-pipeline-for-zero-shot-text-classification%2F681%2F14%23%3A~%3Atext%3DThanks%2520for%2520the%2Cadd%2520a%2520bit%253A). But I am facing difficulties in implementing this. Can anyone please share the snippet that they used or direct me to any source that has implemented the fine-tuning

---

<div class="post-metadata">

**Author:** ![anwarika](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@anwarika](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fanwarika)%5C
**Post date:** [March 7, 2022, 12:39am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338%2F2 "2022-03-07T00:39:04Z")

</div>

What part are you having trouble with?

---

<div class="post-metadata">

**Author:** ![ShieldHero](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shieldhero/32/4451_2.png) [@ShieldHero](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FShieldHero)%5C
**Post date:** [March 8, 2022, 4:14am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338%2F3 "2022-03-08T04:14:30Z")

</div>

@anwarika don’t understand how to set ‘entailment’ or ‘contradiction’ as a target.

---

<div class="post-metadata">

**Author:** ![anwarika](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@anwarika](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fanwarika)%5C
**Post date:** [March 8, 2022, 2:06pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338%2F4 "2022-03-08T14:06:08Z")

</div>

So to understand you have 1000 examples that are not properly labelled? If they are properly labeled you could just fineTune it. There are some examples in the Transformers github repo

---

<div class="post-metadata">

**Author:** ![elmerpsarabia](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@elmerpsarabia](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Felmerpsarabia)%5C
**Post date:** [February 7, 2023, 7:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-zero-shot-models%2F15338%2F5 "2023-02-07T19:32:03Z")

</div>

Could anyone please share some links to this examples?, I haven’t found them yet. Thanks for your help.
