init
Browse files- download_audio.py +8 -8
download_audio.py
CHANGED
@@ -36,7 +36,7 @@ line_no_end = int(os.getenv("LINE_NO_END", 10000))
|
|
36 |
dataset_id = os.getenv("DATASET_ID", 0)
|
37 |
hf_org = os.getenv("HF_ORG", "asahi417")
|
38 |
hf_dataset = f"seamless-align-{direction}"
|
39 |
-
skip_wget = bool(int(os.getenv("SKIP_WGET",
|
40 |
|
41 |
|
42 |
def wget(url: str, output_file: Optional[str] = None):
|
@@ -129,13 +129,13 @@ if __name__ == '__main__':
|
|
129 |
if not skip_wget:
|
130 |
df_metadata = get_metadata()
|
131 |
print(f"metadata: {len(df_metadata)}, {line_no_start} --> {line_no_end}")
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
inputs = [g for line_no, g in df_metadata.groupby("line_no") if line_no_start <= line_no < line_no_end]
|
139 |
print(f"filtered unique lines: {len(inputs)}")
|
140 |
if direction == "enA-jaA":
|
141 |
inputs = [g for g in inputs if len(g["side"].unique()) == 2 and set(g["side"].unique()) == sides]
|
|
|
36 |
dataset_id = os.getenv("DATASET_ID", 0)
|
37 |
hf_org = os.getenv("HF_ORG", "asahi417")
|
38 |
hf_dataset = f"seamless-align-{direction}"
|
39 |
+
skip_wget = bool(int(os.getenv("SKIP_WGET", 0)))
|
40 |
|
41 |
|
42 |
def wget(url: str, output_file: Optional[str] = None):
|
|
|
129 |
if not skip_wget:
|
130 |
df_metadata = get_metadata()
|
131 |
print(f"metadata: {len(df_metadata)}, {line_no_start} --> {line_no_end}")
|
132 |
+
inputs = [
|
133 |
+
g for line_no, g in df_metadata.groupby("line_no")
|
134 |
+
if line_no_start <= line_no < line_no_end and not os.path.exists(
|
135 |
+
p_join(cache_dir_feature, f'{int(line_no)}.json')
|
136 |
+
)
|
137 |
+
]
|
138 |
+
# inputs = [g for line_no, g in df_metadata.groupby("line_no") if line_no_start <= line_no < line_no_end]
|
139 |
print(f"filtered unique lines: {len(inputs)}")
|
140 |
if direction == "enA-jaA":
|
141 |
inputs = [g for g in inputs if len(g["side"].unique()) == 2 and set(g["side"].unique()) == sides]
|