# Error in fine-tuning bert with custom text

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-in-fine-tuning-bert-with-custom-text%2F16823%3E%5C
**Category:** Beginners\
**Created:** [April 14, 2022, 6:26am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-in-fine-tuning-bert-with-custom-text%2F16823 "2022-04-14T06:26:00Z")\
**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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fvinrok)%5C
**Post date:** [April 14, 2022, 6:26am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ferror-in-fine-tuning-bert-with-custom-text%2F16823%2F1 "2022-04-14T06:26:00Z")

</div>

Hi, I am using a hugging face transformer to fine-tune the BERT model using my custom text corpus.

But it gives me an error in the training phase -  
_IndexError: Invalid key: 2664 is out of bounds for size 0_

Kindly find the link to google colab here - [Fine-tune Bert model](https://colab.research.google.com/drive/1LhnRp-tvxUEm3etxod3zb90JCHnSyFqc?usp=sharing)

Any help is appreciated. Kindly help me to make through it.

Regards,  
Vinay
