Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi,when I train wav2vec-xlsr, prompt “you should pass attention_mask when working with Wav2Vec2 new checkpoints”,what should I do? When do you plan to add the attention_mask for train? #22

Closed
dengcunqin opened this issue Sep 17, 2021 · 5 comments

Comments

@dengcunqin
Copy link

hi,when I train wav2vec-xlsr, prompt “you should pass attention_mask when working with Wav2Vec2 new checkpoints”,what should I do? When do you plan to add the attention_mask for train?

@thevasudevgupta
Copy link
Owner

Hello @dengcunqin,

Are you using this script?
If so, this script won't work with gsoc-wav2vec2-xlsr-53 and is only compatible with gsoc-wav2vec2-960h.

The major difference in both ckpts (in terms of usage) is that gsoc-wav2vec2-xlsr-53 also accepts attention_mask while gsoc-wav2vec2-960h doesn't.

You can use gsoc-wav2vec2-xlsr-53 like this:

from wav2vec2 import Wav2Vec2ForCTC

model = Wav2Vec2ForCTC.from_pretrained("vasudevgupta/gsoc-wav2vec2-xlsr-53")

speech: tf.Tensor
attention_mask: tf.Tensor # 0 for padding positions & 1 otherwise

outputs = model(speech, attention_mask=attention_mask)

In case you are using this script, you will have to change the dataloading part appropriately so that dataset object also returns attention_mask; then then probably you will be able to use that script.

@dengcunqin
Copy link
Author

Do you have any plans for update training code for gsoc-wav2vec2-xlsr-53?

@thevasudevgupta
Copy link
Owner

Hey, I am little busy with some other project. So, wouldn’t be able to find time for this sometime soon.

@dengcunqin
Copy link
Author

dengcunqin commented Sep 18, 2021

get

@thevasudevgupta
Copy link
Owner

Closing this issue then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants