# Batch input for wav2vec2 pretraining

**URL:** <https://discuss.huggingface.co/t/batch-input-for-wav2vec2-pretraining/8133>\
**Category:** Beginners\
**Created:** [July 7, 2021, 10:42am UTC](https://discuss.huggingface.co/t/batch-input-for-wav2vec2-pretraining/8133 "2021-07-07T10:42:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kouohhashi](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@kouohhashi](https://discuss.huggingface.co/u/kouohhashi)\
**Post date:** [July 7, 2021, 10:42am UTC](https://discuss.huggingface.co/t/batch-input-for-wav2vec2-pretraining/8133/1 "2021-07-07T10:42:08Z")

</div>

Hi I have a question about how to pad audio when training wav2vec2 model.

The tutorial explains how to handle batch size of one.

```auto
input_values = processor(ds["speech"][0], return_tensors="pt").input_values # Batch size 1
logits = model(input_values).logits
predicted_ids = torch.argmax(logits, dim=-1)

```

But I think I need to pad shorter audio when batch size is bigger than 2.

Can I pad shorter audio with 0 ?  
or is there convenient function for that?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kouohhashi](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@kouohhashi](https://discuss.huggingface.co/u/kouohhashi)\
**Post date:** [July 15, 2021, 8:53am UTC](https://discuss.huggingface.co/t/batch-input-for-wav2vec2-pretraining/8133/2 "2021-07-15T08:53:45Z")

</div>

[Found Answer]  
It’s going to pad with 0.0. I found it…
