# Wav2Vec2 Processor padding strategy

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-processor-padding-strategy%2F64975%3E%5C
**Category:** 🤗Transformers\
**Created:** [December 7, 2023, 7:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-processor-padding-strategy%2F64975 "2023-12-07T19:22:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![menevsem](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/menevsem/32/50697_2.png) [@menevsem](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmenevsem)%5C
**Post date:** [December 7, 2023, 7:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fwav2vec2-processor-padding-strategy%2F64975%2F1 "2023-12-07T19:22:10Z")

</div>

Hello,  
I am using data collator function from [this tutorial (Fine-Tune Wav2Vec2 for English ASR)]. ([Fine-Tune Wav2Vec2 for English ASR in Hugging Face with 🤗 Transformers](https://huggingface.co/blog/fine-tune-wav2vec2-english)) I would like to pad the input tensors to a max length in the data collator part using Wav2Vec2 processor.  
First option is, setting the padding as True and setting the max\_length as following:

```auto
        batch = self.processor.pad(
            input_features,
            padding=True,
            max_length=1000,
            return_tensors="pt",
        )

```

but it doesn’t give me desired 1000 long vectors, instead it pads them to their max value. So I change the parameters as following:

```auto
       batch = self.processor.pad(
            input_features,
            padding='max_length',
            max_length=1000,
            return_tensors="pt",
        )

```

This results in the following error:

```auto
ValueError: Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.

```

How should I set the padding parameter so that all the input features are padded to max\_length?
