From fb2d7c642a286da9ff3cd64a4a48771a9f2cdd87 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Wed, 9 Dec 2020 10:32:00 -0500 Subject: [PATCH] Cherry-pick 'Disallow download=True in CommonVoice (#1076)' --- torchaudio/datasets/commonvoice.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/torchaudio/datasets/commonvoice.py b/torchaudio/datasets/commonvoice.py index 963777cf38..a0f0b9ffea 100644 --- a/torchaudio/datasets/commonvoice.py +++ b/torchaudio/datasets/commonvoice.py @@ -180,6 +180,15 @@ def __init__(self, "romansh sursilvan": "rm-sursilv" } + if download: + raise RuntimeError( + "Common Voice dataset requires user agreement on the usage term, " + "and torchaudio no longer provides the download feature. " + "Please download the dataset manually and extract it in the root directory, " + "then provide the target language to `url` argument.") + if url not in languages: + raise ValueError(f"`url` must be one of available languages: {languages.keys()}") + if url in languages: ext_archive = ".tar.gz" language = languages[url]