Fixed output_all_hiddens for hubert in huggingface_wav2vec#1587
Fixed output_all_hiddens for hubert in huggingface_wav2vec#1587TParcollet merged 2 commits intospeechbrain:developfrom
Conversation
|
Hi @gorinars, thanks for trying this PR and pointing this out. It is true that I didn't test for all the models, however, if I made it right, these models output attentions at the very end which is |
|
Thanks for a quick reply @BenoitWang. It seems that all models I am testing have Let me test a bit more with different settings. Here is a simple test that I currently use and that passes for wav2vec and wavlm but fails for hubert. |
|
OK, so enforcing thoughts? |
|
Yes much neater, and hope that they use always the same names for all the models:). Thanks! |
|
@BenoitWang could you review the PR and merge if it looks good to you? Thanks! |
I am trying to extract all hidden representations from several HF models using recently implemented in #1570
output_all_hiddensproperty.Specifically, I used
source=["facebook/wav2vec2-base", "facebook/hubert-base-ls960", "microsoft/wavlm-base", "microsoft/wavlm-base-plus"]inHuggingFaceWav2Vec2class.All works good except Hubert where we have
dim(out) = 2so the code crashes.Unlike others, it does not have a 512-dimensional representation in the
out[1], which is not used anyway.Taking the last dimension for accessing all transformer layers should work for all these models unless I am missing something.