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

add ssl feature extractor #881

Merged
merged 5 commits into from
Nov 9, 2022
Merged

add ssl feature extractor #881

merged 5 commits into from
Nov 9, 2022

Conversation

DongjiGao
Copy link
Contributor

The SSL extractor is supported by S3PRL

Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

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

Looks great, thank you! I left one comment, otherwise LGTM

assert (
sampling_rate == 16000
), f"All the upstream models in S3PRL now only support 16 kHz audio."
feature_dim = 1024
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might want to move feature_dim, sampling_rate, and frame_shift to the config to let people override it for different models (even if today they all use the same setting)

@csukuangfj
Copy link
Contributor

Shall we add tests for it?

@pzelasko
Copy link
Collaborator

pzelasko commented Nov 7, 2022

I'm afraid that it will require downloading a big pretrained model from somewhere, which won't be very convenient either for CI or local testing. WDYT?

@csukuangfj
Copy link
Contributor

In icefall we upload the pretrained models to huggingface and download them in CI for testing using git lfs.

A file an be several hundred MB and it's very fast to download in the CI.

@pzelasko
Copy link
Collaborator

pzelasko commented Nov 7, 2022

Cool! @DongjiGao could you contribute a test for it? You can use a decorator on the test function to make the test optional. Then add s3prl.hub installation in .github/workflows/unit_tests.yml to enable the test being run.

Decorator example:

@pytest.mark.skipif(not is_module_available("s3prl.hub"), reason="The test requires s3prl to run.")
def test_s3prl_feature_extractor():
    ...

@DongjiGao
Copy link
Contributor Author

Cool! @DongjiGao could you contribute a test for it? You can use a decorator on the test function to make the test optional. Then add s3prl.hub installation in .github/workflows/unit_tests.yml to enable the test being run.

Decorator example:

@pytest.mark.skipif(not is_module_available("s3prl.hub"), reason="The test requires s3prl to run.")
def test_s3prl_feature_extractor():
    ...

Sure.

@desh2608
Copy link
Collaborator

desh2608 commented Nov 8, 2022

@DongjiGao I'm wondering if perhaps you could add a comment somewhere (maybe as a docstring for the class), with a link to where users could find other pretrained models (and their configs like frame_shift, feature_dim, etc.)?

Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

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

You'll need to make these changes to let the tests pass



@pytest.mark.skipif(
not is_module_available("s3prl.hub"), reason="The test requires s3prl to run."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
not is_module_available("s3prl.hub"), reason="The test requires s3prl to run."
not is_module_available("s3prl"), reason="The test requires s3prl to run."



@pytest.mark.skipif(
not is_module_available("s3prl.hub"), reason="The test requires s3prl to run."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
not is_module_available("s3prl.hub"), reason="The test requires s3prl to run."
not is_module_available("s3prl"), reason="The test requires s3prl to run."

@pzelasko
Copy link
Collaborator

pzelasko commented Nov 8, 2022

Also please remember about adding s3prl installation to the CI .github/workflows/unit_tests.yml

@DongjiGao
Copy link
Contributor Author

@DongjiGao I'm wondering if perhaps you could add a comment somewhere (maybe as a docstring for the class), with a link to where users could find other pretrained models (and their configs like frame_shift, feature_dim, etc.)?

Adding it now.

@DongjiGao
Copy link
Contributor Author

Also please remember about adding s3prl installation to the CI .github/workflows/unit_tests.yml

Sorry I was using a personal token previously and was blocked to change that file. I have added the s3prl installation now.

@DongjiGao
Copy link
Contributor Author

@pzelasko @csukuangfj @desh2608 Do you think the code is good to check in?

@desh2608
Copy link
Collaborator

desh2608 commented Nov 9, 2022

LGTM.

@pzelasko pzelasko merged commit 720d142 into lhotse-speech:master Nov 9, 2022
@pzelasko pzelasko added this to the v1.10 milestone Nov 9, 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.

4 participants