Commit ccda545c authored by atalman's avatar atalman Committed by Facebook GitHub Bot
Browse files

Toggle on/off ffmpeg test if needed (#2901)

Summary:
Toggle on/off ffmpeg test if needed
By default it ON, hence should not affect any current tests.
To toggle ON no change required.
To toggle OFF use:
```
smoke_test.py --no-ffmpeg
```

To be used when calling from builder currently. Since we do not install ffmpeg currently.

Pull Request resolved: https://github.com/pytorch/audio/pull/2901

Reviewed By: carolineechen, mthrok

Differential Revision: D41874976

Pulled By: atalman

fbshipit-source-id: c57b19f37c63a1f476f93a5211550e980e67d9c7
parent 41d007b4
"""Run smoke tests"""
import argparse
import torchaudio # noqa: F401
import torchaudio.compliance.kaldi # noqa: F401
import torchaudio.datasets # noqa: F401
......@@ -9,4 +11,22 @@ import torchaudio.pipelines # noqa: F401
import torchaudio.sox_effects # noqa: F401
import torchaudio.transforms # noqa: F401
import torchaudio.utils # noqa: F401
from torchaudio.io import StreamReader # noqa: F401
def ffmpeg_test():
from torchaudio.io import StreamReader # noqa: F401
def main() -> None:
parser = argparse.ArgumentParser()
# Warning: Please note this option should not be widely used, only use it when absolutely necessary
parser.add_argument("--no-ffmpeg", dest="ffmpeg", action="store_false")
options = parser.parse_args()
if options.ffmpeg:
ffmpeg_test()
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment