Skip to content

make kaldi selective#1342

Merged
mthrok merged 4 commits intopytorch:masterfrom
carolineechen:make_kaldi_selective
Mar 3, 2021
Merged

make kaldi selective#1342
mthrok merged 4 commits intopytorch:masterfrom
carolineechen:make_kaldi_selective

Conversation

@carolineechen
Copy link
Contributor

support functionality to compile without kaldi, similar to #1338

Copy link
Contributor

@mthrok mthrok left a comment

Choose a reason for hiding this comment

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

Looks good. Let's resolve CI issue and it's good merge.



_BUILD_SOX = _get_build("BUILD_SOX")
_BUILD_KALDI = _get_build("BUILD_KALDI")
Copy link
Contributor

Choose a reason for hiding this comment

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

Because we currently default to build Kaldi, in case the environment variable is missing, we need to default to true for this.

Please update the _get_build to allow override of default value.

def _get_build(var):
if (var == "BUILD_KALDI") and not os.environ.get(var):
return True

Copy link
Contributor

@mthrok mthrok Mar 3, 2021

Choose a reason for hiding this comment

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

Although this works for our purpose, let's keep this function generic. How about this?

def _get_build(var, default_val=False):
    if val not in os.ennviron:
        return default_val
    val = os.environ[var]
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point 👍

def skipIfNoExtension(test_item):
if is_module_available('torchaudio._torchaudio'):
return test_item
if 'TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION' in os.environ:
Copy link
Contributor

Choose a reason for hiding this comment

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

follow-up (@mthrok): Revive this mechanism with new semantic.

$ grep TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSIO -r .circleci/
.circleci/unittest/linux/scripts/run_test.sh:export TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION=1

@mthrok mthrok merged commit 3c44837 into pytorch:master Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants