Datasets:
Commit
·
fcfea9e
1
Parent(s):
dc3d0eb
add more debug
Browse files
odor.py
CHANGED
@@ -68,8 +68,8 @@ class ODOR(datasets.GeneratorBasedBuilder):
|
|
68 |
|
69 |
def _split_generators(self, dl_manager):
|
70 |
|
71 |
-
def _download_file(uri,
|
72 |
-
path = f'{
|
73 |
|
74 |
if os.path.exists(path) and not overwrite:
|
75 |
return fn
|
@@ -80,7 +80,7 @@ class ODOR(datasets.GeneratorBasedBuilder):
|
|
80 |
except (MissingSchema, Timeout, ConnectionError, InvalidSchema):
|
81 |
time.sleep(i)
|
82 |
continue
|
83 |
-
|
84 |
if r.status_code == 200:
|
85 |
with open(path, 'wb') as f:
|
86 |
for chunk in r:
|
|
|
68 |
|
69 |
def _split_generators(self, dl_manager):
|
70 |
|
71 |
+
def _download_file(uri, target_dir, fn, retries, overwrite=False):
|
72 |
+
path = f'{target_dir}/{fn}'
|
73 |
|
74 |
if os.path.exists(path) and not overwrite:
|
75 |
return fn
|
|
|
80 |
except (MissingSchema, Timeout, ConnectionError, InvalidSchema):
|
81 |
time.sleep(i)
|
82 |
continue
|
83 |
+
print(f'{os.path.isdir(target_dir)}')
|
84 |
if r.status_code == 200:
|
85 |
with open(path, 'wb') as f:
|
86 |
for chunk in r:
|