Skip to content

Commit 07d9bc2

Browse files
authored
[BC-Breaking] Remove deprecated arguments from CommonVoice (#1534)
These arguments are deprecated in 0.8 release for legal reasons, and not used anymore. Now we can remove the arguments.
1 parent 9d45c8c commit 07d9bc2

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

torchaudio/datasets/commonvoice.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import csv
22
import os
3-
import warnings
43
from pathlib import Path
5-
from typing import List, Dict, Tuple, Union, Optional
4+
from typing import List, Dict, Tuple, Union
65

76
from torch import Tensor
87
from torch.utils.data import Dataset
@@ -40,10 +39,6 @@ class COMMONVOICE(Dataset):
4039
The name of the tsv file used to construct the metadata, such as
4140
``"train.tsv"``, ``"test.tsv"``, ``"dev.tsv"``, ``"invalidated.tsv"``,
4241
``"validated.tsv"`` and ``"other.tsv"``. (default: ``"train.tsv"``)
43-
url (str, optional): Deprecated, not used.
44-
folder_in_archive (str, optional): Deprecated, not used.
45-
version (str): Deprecated, not used.
46-
download (bool, optional): Deprecated, not used.
4742
"""
4843

4944
_ext_txt = ".txt"
@@ -52,29 +47,7 @@ class COMMONVOICE(Dataset):
5247

5348
def __init__(self,
5449
root: Union[str, Path],
55-
tsv: str = "train.tsv",
56-
url: Optional[str] = None,
57-
folder_in_archive: Optional[str] = None,
58-
version: Optional[str] = None,
59-
download: Optional[bool] = None) -> None:
60-
if download:
61-
raise RuntimeError(
62-
"Common Voice dataset requires user agreement on the usage term, "
63-
"and torchaudio no longer provides the download feature. "
64-
"Please download the dataset and extract it manually.")
65-
66-
deprecated = [
67-
('url', url),
68-
('folder_in_archive', folder_in_archive),
69-
('version', version),
70-
('download', download)
71-
]
72-
for name, val in deprecated:
73-
if val is not None:
74-
warnings.warn(
75-
f"`{name}` argument is no longer used and deprecated. "
76-
"It will be removed in 0.9.0 releaase. "
77-
"Please remove it from the function call")
50+
tsv: str = "train.tsv") -> None:
7851

7952
# Get string representation of 'root' in case Path object is passed
8053
self._path = os.fspath(root)

0 commit comments

Comments
 (0)