mnansary commited on
Commit ·
ab77b9f
1
Parent(s): 0420121
data
Browse files
cvbn.py
CHANGED
|
@@ -18,12 +18,9 @@
|
|
| 18 |
import csv
|
| 19 |
import os
|
| 20 |
import urllib
|
| 21 |
-
import shutil
|
| 22 |
import datasets
|
| 23 |
import requests
|
| 24 |
from datasets.utils.py_utils import size_str
|
| 25 |
-
from huggingface_hub import HfApi, HfFolder
|
| 26 |
-
|
| 27 |
from .languages import LANGUAGES
|
| 28 |
from .release_stats import STATS
|
| 29 |
_CITATION = """\
|
|
@@ -39,9 +36,7 @@ _CITATION = """\
|
|
| 39 |
_HOMEPAGE = "https://commonvoice.mozilla.org/bn/datasets"
|
| 40 |
|
| 41 |
_LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
|
| 42 |
-
|
| 43 |
_API_URL = "https://commonvoice.mozilla.org/api/v1"
|
| 44 |
-
|
| 45 |
_TRAIN_XZ="https://drive.google.com/uc?id=1KYTCAi9J25ngzxq22mCrKTEVg0i3ZVil"
|
| 46 |
_DEV_XZ="https://drive.google.com/uc?id=1Q_h5HbF9BDT0_RE14gTvlcfzR2HIQyMW"
|
| 47 |
_TEST_XZ="https://drive.google.com/uc?id=1gMr7heiYMpNHdnOuyAHzyzVx6MBL9MEv"
|
|
@@ -137,27 +132,14 @@ class CommonVoice(datasets.GeneratorBasedBuilder):
|
|
| 137 |
response = requests.get(f"{_API_URL}/bucket/dataset/{path}", timeout=10.0).json()
|
| 138 |
return response["url"]
|
| 139 |
|
| 140 |
-
|
| 141 |
-
# if isinstance(auth_token, bool):
|
| 142 |
-
# auth_token = HfFolder().get_token()
|
| 143 |
-
# whoami = HfApi().whoami(auth_token)
|
| 144 |
-
# email = whoami["email"] if "email" in whoami else ""
|
| 145 |
-
# payload = {"email": email, "locale": locale, "dataset": bundle_version}
|
| 146 |
-
# requests.post(f"{_API_URL}/{locale}/downloaders", json=payload).json()
|
| 147 |
-
|
| 148 |
def _split_generators(self, dl_manager):
|
| 149 |
"""Returns SplitGenerators."""
|
| 150 |
-
|
| 151 |
-
# if hf_auth_token is None:
|
| 152 |
-
# raise ConnectionError(
|
| 153 |
-
# "Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset"
|
| 154 |
-
# )
|
| 155 |
-
|
| 156 |
bundle_url_template = STATS["bundleURLTemplate"]
|
| 157 |
bundle_version = bundle_url_template.split("/")[0]
|
| 158 |
dl_manager.download_config.ignore_url_params = True
|
| 159 |
|
| 160 |
-
#self._log_download(self.config.name, bundle_version, hf_auth_token)
|
| 161 |
archive_path = dl_manager.download(self._get_bundle_url(self.config.name, bundle_url_template))
|
| 162 |
local_extracted_archive = dl_manager.extract(archive_path) if not dl_manager.is_streaming else None
|
| 163 |
|
|
|
|
| 18 |
import csv
|
| 19 |
import os
|
| 20 |
import urllib
|
|
|
|
| 21 |
import datasets
|
| 22 |
import requests
|
| 23 |
from datasets.utils.py_utils import size_str
|
|
|
|
|
|
|
| 24 |
from .languages import LANGUAGES
|
| 25 |
from .release_stats import STATS
|
| 26 |
_CITATION = """\
|
|
|
|
| 36 |
_HOMEPAGE = "https://commonvoice.mozilla.org/bn/datasets"
|
| 37 |
|
| 38 |
_LICENSE = "https://creativecommons.org/publicdomain/zero/1.0/"
|
|
|
|
| 39 |
_API_URL = "https://commonvoice.mozilla.org/api/v1"
|
|
|
|
| 40 |
_TRAIN_XZ="https://drive.google.com/uc?id=1KYTCAi9J25ngzxq22mCrKTEVg0i3ZVil"
|
| 41 |
_DEV_XZ="https://drive.google.com/uc?id=1Q_h5HbF9BDT0_RE14gTvlcfzR2HIQyMW"
|
| 42 |
_TEST_XZ="https://drive.google.com/uc?id=1gMr7heiYMpNHdnOuyAHzyzVx6MBL9MEv"
|
|
|
|
| 132 |
response = requests.get(f"{_API_URL}/bucket/dataset/{path}", timeout=10.0).json()
|
| 133 |
return response["url"]
|
| 134 |
|
| 135 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
def _split_generators(self, dl_manager):
|
| 137 |
"""Returns SplitGenerators."""
|
| 138 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
bundle_url_template = STATS["bundleURLTemplate"]
|
| 140 |
bundle_version = bundle_url_template.split("/")[0]
|
| 141 |
dl_manager.download_config.ignore_url_params = True
|
| 142 |
|
|
|
|
| 143 |
archive_path = dl_manager.download(self._get_bundle_url(self.config.name, bundle_url_template))
|
| 144 |
local_extracted_archive = dl_manager.extract(archive_path) if not dl_manager.is_streaming else None
|
| 145 |
|