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

[Tests] Correct Wav2Vec2 & WavLM tests #15015

Merged

Conversation

patrickvonplaten
Copy link
Contributor

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Sorry, something went wrong.

@@ -556,18 +556,17 @@ def test_inference_ctc_robust_batched(self):
@require_pyctcdecode
@require_librosa
def test_wav2vec2_with_lm(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't nicely load mp3 at the moment with datasets -> let's just use a .wav file for now

@@ -452,30 +451,9 @@ def _mock_init_weights(self, module):
if hasattr(module, "masked_spec_embed") and module.masked_spec_embed is not None:
module.masked_spec_embed.data.fill_(3)

# overwrite from test_modeling_common
# as WavLM is not very precise
@unittest.skip(reason="Feed forward chunking is not implemented for WavLM")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feed forward chunking is not even implemented by WavLM

@@ -544,8 +522,9 @@ def test_inference_large(self):
)

EXPECTED_HIDDEN_STATES_SLICE = torch.tensor(
[[[0.1612, 0.4314], [0.1690, 0.4344]], [[0.2086, 0.1396], [0.3014, 0.0903]]]
[[[0.2122, 0.0500], [0.2118, 0.0563]], [[0.1353, 0.1818], [0.2453, 0.0595]]]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this was incorrect

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it ever pass? If so, it would be nice to checkout an earlier commit on which it passed and check the difference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know what was going on here. I'm sure though that the checkpoint works correctly as the model gives great results when fine-tuning -> see: https://huggingface.co/patrickvonplaten/wavlm-libri-clean-100h-large (tested on dec 17th: https://huggingface.co/patrickvonplaten/wavlm-libri-clean-100h-large/commit/a1b7ace90561bafd37167ca73c72833ad345963f) and there hasn't been a model change in the checkpoint's repo since december 16th: https://huggingface.co/microsoft/wavlm-large/commit/38b04afdf061607fdccc24c4ca4e8c3ae339012f

So the checkpoint is fine. Really not sure what was/is going on with this test. Will monitor in the coming days

@patrickvonplaten patrickvonplaten changed the title [Tests] correct some tests [Tests] Correct Wav2Vec2 & WavLM tests Jan 3, 2022
@@ -544,8 +522,9 @@ def test_inference_large(self):
)

EXPECTED_HIDDEN_STATES_SLICE = torch.tensor(
[[[0.1612, 0.4314], [0.1690, 0.4344]], [[0.2086, 0.1396], [0.3014, 0.0903]]]
[[[0.2122, 0.0500], [0.2118, 0.0563]], [[0.1353, 0.1818], [0.2453, 0.0595]]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it ever pass? If so, it would be nice to checkout an earlier commit on which it passed and check the difference

@patrickvonplaten patrickvonplaten merged commit dbac889 into huggingface:master Jan 3, 2022
@patrickvonplaten patrickvonplaten deleted the correct_wav2vec2_tests branch January 3, 2022 19:19
stevhliu pushed a commit to stevhliu/transformers that referenced this pull request Jan 6, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants