From 1240a0776ab0b96a90f604cfd9736f6213d2968b Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Mon, 31 May 2021 16:15:43 +0000 Subject: [PATCH 1/2] [BC-Breaking] Remove deprecated arguments from CommonVoice --- torchaudio/datasets/commonvoice.py | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/torchaudio/datasets/commonvoice.py b/torchaudio/datasets/commonvoice.py index 75fd84843f..f5ee07b260 100644 --- a/torchaudio/datasets/commonvoice.py +++ b/torchaudio/datasets/commonvoice.py @@ -40,10 +40,6 @@ class COMMONVOICE(Dataset): The name of the tsv file used to construct the metadata, such as ``"train.tsv"``, ``"test.tsv"``, ``"dev.tsv"``, ``"invalidated.tsv"``, ``"validated.tsv"`` and ``"other.tsv"``. (default: ``"train.tsv"``) - url (str, optional): Deprecated, not used. - folder_in_archive (str, optional): Deprecated, not used. - version (str): Deprecated, not used. - download (bool, optional): Deprecated, not used. """ _ext_txt = ".txt" @@ -52,29 +48,7 @@ class COMMONVOICE(Dataset): def __init__(self, root: Union[str, Path], - tsv: str = "train.tsv", - url: Optional[str] = None, - folder_in_archive: Optional[str] = None, - version: Optional[str] = None, - download: Optional[bool] = None) -> None: - 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 and extract it manually.") - - deprecated = [ - ('url', url), - ('folder_in_archive', folder_in_archive), - ('version', version), - ('download', download) - ] - for name, val in deprecated: - if val is not None: - warnings.warn( - f"`{name}` argument is no longer used and deprecated. " - "It will be removed in 0.9.0 releaase. " - "Please remove it from the function call") + tsv: str = "train.tsv") -> None: # Get string representation of 'root' in case Path object is passed self._path = os.fspath(root) From 9d6dd740e0e0c9e377e304fa8f0bb5db673814c6 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Mon, 31 May 2021 16:23:08 +0000 Subject: [PATCH 2/2] Fix style --- torchaudio/datasets/commonvoice.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/torchaudio/datasets/commonvoice.py b/torchaudio/datasets/commonvoice.py index f5ee07b260..1aed80a745 100644 --- a/torchaudio/datasets/commonvoice.py +++ b/torchaudio/datasets/commonvoice.py @@ -1,8 +1,7 @@ import csv import os -import warnings from pathlib import Path -from typing import List, Dict, Tuple, Union, Optional +from typing import List, Dict, Tuple, Union from torch import Tensor from torch.utils.data import Dataset