Datasets:
ProgramComputer
commited on
Commit
·
4f051fb
1
Parent(s):
981a2bf
head restore
Browse files- vox_celeb.py +5 -0
vox_celeb.py
CHANGED
@@ -241,6 +241,11 @@ class VoxCeleb(datasets.GeneratorBasedBuilder):
|
|
241 |
lengths = []
|
242 |
start_positions = []
|
243 |
for url in sources:
|
|
|
|
|
|
|
|
|
|
|
244 |
save_credentials()
|
245 |
content_length = head.headers.get("Content-Length")
|
246 |
if content_length is None:
|
|
|
241 |
lengths = []
|
242 |
start_positions = []
|
243 |
for url in sources:
|
244 |
+
head = requests.head(url, auth=(cred_key))
|
245 |
+
if head.status_code == 401:
|
246 |
+
raise ValueError("failed to authenticate with VoxCeleb host")
|
247 |
+
if head.status_code < 200 or head.status_code >= 300:
|
248 |
+
raise ValueError("failed to fetch dataset")
|
249 |
save_credentials()
|
250 |
content_length = head.headers.get("Content-Length")
|
251 |
if content_length is None:
|