# KeyError: 0 in data\_collator.py

**URL:** <https://discuss.huggingface.co/t/keyerror-0-in-data-collator-py/31498>\
**Category:** 🤗Transformers\
**Created:** [February 11, 2023, 12:45pm UTC](https://discuss.huggingface.co/t/keyerror-0-in-data-collator-py/31498 "2023-02-11T12:45:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![codkiller0911](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@codkiller0911](https://discuss.huggingface.co/u/codkiller0911)\
**Post date:** [February 11, 2023, 12:45pm UTC](https://discuss.huggingface.co/t/keyerror-0-in-data-collator-py/31498/1 "2023-02-11T12:45:18Z")

</div>

I’m trying to fine-tune the model from AutoModelForSeq2SeqLM.from\_pretrained(“SEBIS/code\_trans\_t5\_base\_code\_comment\_generation\_java\_transfer\_learning\_finetune”)

I have a custom dataset containing two columns. Containing Kotlin functions and their documentation.

Pleae look at the link on stackover flow for the complete code. Earlier i was getting RuntimeError: Coulsd not infer dtype of dict. But I renamed labels to labels\_ids and not getting Key Error

> <https://stackoverflow.com/questions/75399318/runtimeerror-could-not-infer-dtype-of-dict>
