ProgramComputer
commited on
Commit
•
a53ad1a
1
Parent(s):
34f2760
Update test.py
Browse files
test.py
CHANGED
@@ -191,32 +191,6 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
191 |
["audio1", "audio2"] if self.config.name == "audio" else [self.config.name]
|
192 |
)
|
193 |
|
194 |
-
|
195 |
-
def download_custom(placeholder_url, path):
|
196 |
-
nonlocal dl_manager
|
197 |
-
sources = _PLACEHOLDER_MAPS[placeholder_url]
|
198 |
-
tmp_paths = []
|
199 |
-
lengths = []
|
200 |
-
start_positions = []
|
201 |
-
for url in sources:
|
202 |
-
head = requests.head(url,timeout=5,stream=True,allow_redirects=True,verify=False)
|
203 |
-
if head.status_code == 401:
|
204 |
-
raise ValueError("failed to authenticate with VoxCeleb host")
|
205 |
-
if head.status_code < 200 or head.status_code >= 300:
|
206 |
-
raise ValueError("failed to fetch dataset")
|
207 |
-
content_length = head.headers.get("Content-Length")
|
208 |
-
if content_length is None:
|
209 |
-
raise ValueError("expected non-empty Content-Length")
|
210 |
-
content_length = int(content_length)
|
211 |
-
tmp_path = Path(path + "." + sha256(url.encode("utf-8")).hexdigest())
|
212 |
-
tmp_paths.append(tmp_path)
|
213 |
-
lengths.append(content_length)
|
214 |
-
start_positions.append(
|
215 |
-
tmp_path.stat().st_size
|
216 |
-
if tmp_path.exists() and dl_manager.download_config.resume_download
|
217 |
-
else 0
|
218 |
-
)
|
219 |
-
|
220 |
def progress(q, cur, total):
|
221 |
with datasets.utils.logging.tqdm(
|
222 |
unit="B",
|
|
|
191 |
["audio1", "audio2"] if self.config.name == "audio" else [self.config.name]
|
192 |
)
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
def progress(q, cur, total):
|
195 |
with datasets.utils.logging.tqdm(
|
196 |
unit="B",
|