# Audio Course. Data collator for ASR fine-tuning

**URL:** <https://discuss.huggingface.co/t/audio-course-data-collator-for-asr-fine-tuning/77308>\
**Category:** Course\
**Created:** [March 13, 2024, 5:43pm UTC](https://discuss.huggingface.co/t/audio-course-data-collator-for-asr-fine-tuning/77308 "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](https://discuss.huggingface.co/u/denis-kazakov)\
**Post date:** [March 13, 2024, 5:43pm UTC](https://discuss.huggingface.co/t/audio-course-data-collator-for-asr-fine-tuning/77308/1 "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”?
