# Batch input for wav2vec2 pretraining

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbatch-input-for-wav2vec2-pretraining%2F8133%3E%5C
**Category:** Beginners\
**Created:** [July 7, 2021, 10:42am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbatch-input-for-wav2vec2-pretraining%2F8133 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkouohhashi)%5C
**Post date:** [July 7, 2021, 10:42am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbatch-input-for-wav2vec2-pretraining%2F8133%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkouohhashi)%5C
**Post date:** [July 15, 2021, 8:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fbatch-input-for-wav2vec2-pretraining%2F8133%2F2 "2021-07-15T08:53:45Z")

</div>

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