# KeyError: 0 in data\_collator.py

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkeyerror-0-in-data-collator-py%2F31498%3E%5C
**Category:** 🤗Transformers\
**Created:** [February 11, 2023, 12:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkeyerror-0-in-data-collator-py%2F31498 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcodkiller0911)%5C
**Post date:** [February 11, 2023, 12:45pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fkeyerror-0-in-data-collator-py%2F31498%2F1 "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>
