# Fine-tuning Zero-shot models

**URL:** <https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338>\
**Category:** Intermediate\
**Created:** [March 4, 2022, 8:28am UTC](https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338 "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](https://discuss.huggingface.co/u/ShieldHero)\
**Post date:** [March 4, 2022, 8:28am UTC](https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338/1 "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](https://discuss.huggingface.co/t/new-pipeline-for-zero-shot-text-classification/681/14#:~:text=Thanks%20for%20the,add%20a%20bit%3A). 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](https://discuss.huggingface.co/u/anwarika)\
**Post date:** [March 7, 2022, 12:39am UTC](https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338/2 "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](https://discuss.huggingface.co/u/ShieldHero)\
**Post date:** [March 8, 2022, 4:14am UTC](https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338/3 "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](https://discuss.huggingface.co/u/anwarika)\
**Post date:** [March 8, 2022, 2:06pm UTC](https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338/4 "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](https://discuss.huggingface.co/u/elmerpsarabia)\
**Post date:** [February 7, 2023, 7:32pm UTC](https://discuss.huggingface.co/t/fine-tuning-zero-shot-models/15338/5 "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.
