init
Browse files- download_audio.py +2 -2
download_audio.py
CHANGED
@@ -27,7 +27,7 @@ n_pool = int(os.getenv("N_POOL", 8))
|
|
27 |
wget_max_retry = os.getenv("MAX_RETRY", "1")
|
28 |
wget_timeout = os.getenv("TIMEOUT", "20")
|
29 |
line_no_start = int(os.getenv("LINE_NO_START", 0))
|
30 |
-
line_no_end = int(os.getenv("LINE_NO_END",
|
31 |
|
32 |
|
33 |
def wget(url: str, output_file: Optional[str] = None):
|
@@ -78,7 +78,7 @@ def get_audio(dataframe: pd.DataFrame):
|
|
78 |
if not os.path.exists(features[f"{side}.path"]):
|
79 |
if not wget(features[f"{side}.url"], output_file=features[f"{side}.path"]):
|
80 |
return False
|
81 |
-
with open(cache_dir_feature, "w") as f:
|
82 |
json.dump(features, f)
|
83 |
return True
|
84 |
|
|
|
27 |
wget_max_retry = os.getenv("MAX_RETRY", "1")
|
28 |
wget_timeout = os.getenv("TIMEOUT", "20")
|
29 |
line_no_start = int(os.getenv("LINE_NO_START", 0))
|
30 |
+
line_no_end = int(os.getenv("LINE_NO_END", 10000))
|
31 |
|
32 |
|
33 |
def wget(url: str, output_file: Optional[str] = None):
|
|
|
78 |
if not os.path.exists(features[f"{side}.path"]):
|
79 |
if not wget(features[f"{side}.url"], output_file=features[f"{side}.path"]):
|
80 |
return False
|
81 |
+
with open(p_join(cache_dir_feature, f'{features["line_no"]}.json'), "w") as f:
|
82 |
json.dump(features, f)
|
83 |
return True
|
84 |
|