# Audio Course. Data collator for ASR fine-tuning

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Faudio-course-data-collator-for-asr-fine-tuning%2F77308%3E%5C
**Category:** Course\
**Created:** [March 13, 2024, 5:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Faudio-course-data-collator-for-asr-fine-tuning%2F77308 "2024-03-13T17:43:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis-kazakov](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/denis-kazakov/32/28314_2.png) [@denis-kazakov](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdenis-kazakov)%5C
**Post date:** [March 13, 2024, 5:43pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Faudio-course-data-collator-for-asr-fine-tuning%2F77308%2F1 "2024-03-13T17:43:20Z")

</div>

Unit 5. ASR. Lesson " Fine-tuning the ASR model" is quite similar to a [blog post on Whisper Fine-tuning](https://huggingface.co/blog/fine-tune-whisper#prepare-feature-extractor-tokenizer-and-data)

But there is a difference in the DataCollatorSpeechSeq2SeqWithPadding definition:

```auto

class DataCollatorSpeechSeq2SeqWithPadding:
    processor: Any

    def __call__ (
        self, features: List[Dict[str, Union[List[int], torch.Tensor]]]
    ) -> Dict[str, torch.Tensor]:
        # split inputs and labels since they have to be of different lengths and need different padding methods
        # first treat the audio inputs by simply returning torch tensors
        input_features = [
            {"input_features": feature["input_features"][0]} for feature in features
        ]

```

The course version has [0] in the last line above, but the blog version does not. So I wonder which one is correct? (I have trouble with both: one does not converge, the other fails, so I will help to know which one to fix.)

I will also be grateful for an explanation of what arguments of this function are at runtime. I.e. what are _feature_ and _features_ in “feature in features”?
