# How to solve index error while fine-tuning BERT model on custom dataset

**URL:** <https://discuss.huggingface.co/t/how-to-solve-index-error-while-fine-tuning-bert-model-on-custom-dataset/16218>\
**Category:** Beginners\
**Created:** [March 29, 2022, 3:31pm UTC](https://discuss.huggingface.co/t/how-to-solve-index-error-while-fine-tuning-bert-model-on-custom-dataset/16218 "2022-03-29T15:31:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinrok](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/vinrok/32/4368_2.png) [@vinrok](https://discuss.huggingface.co/u/vinrok)\
**Post date:** [March 29, 2022, 3:31pm UTC](https://discuss.huggingface.co/t/how-to-solve-index-error-while-fine-tuning-bert-model-on-custom-dataset/16218/1 "2022-03-29T15:31:30Z")

</div>

Hi,

I am facing Index Error, while fine tuning **BERT** model on custom text corpus.

Kindly help me to solve it.

Kindly find the screenshot of error attached and colab link for code here - [Google Colab](https://colab.research.google.com/drive/1LhnRp-tvxUEm3etxod3zb90JCHnSyFqc?usp=sharing)

Regards,

Vinay

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/7/74fe0350f3d52f0e1c9f6354d5b370bed86dabce.png)
