init
Browse files- tokenize_dataset_s2s.py +2 -2
tokenize_dataset_s2s.py
CHANGED
@@ -16,7 +16,7 @@ hf_org = os.getenv("HF_ORG", "asahi417")
|
|
16 |
hf_dataset = f"seamless-align-{direction}"
|
17 |
dataset = load_dataset(f"{hf_org}/{hf_dataset}", f"subset_{dataset_id}", split="train")
|
18 |
tokenizer = EncodecTokenizer.from_pretrained()
|
19 |
-
|
20 |
audio_loader = Audio()
|
21 |
|
22 |
|
@@ -24,7 +24,7 @@ def error_file(example):
|
|
24 |
for side in sides:
|
25 |
try:
|
26 |
wav = audio_loader.decode_example(example[f"{side}.audio"])
|
27 |
-
if len(wav["array"]) == 0:
|
28 |
return False
|
29 |
except LibsndfileError:
|
30 |
return False
|
|
|
16 |
hf_dataset = f"seamless-align-{direction}"
|
17 |
dataset = load_dataset(f"{hf_org}/{hf_dataset}", f"subset_{dataset_id}", split="train")
|
18 |
tokenizer = EncodecTokenizer.from_pretrained()
|
19 |
+
max_seq_length = 130000000
|
20 |
audio_loader = Audio()
|
21 |
|
22 |
|
|
|
24 |
for side in sides:
|
25 |
try:
|
26 |
wav = audio_loader.decode_example(example[f"{side}.audio"])
|
27 |
+
if len(wav["array"]) == 0 or len(wav["array"]) > max_seq_length:
|
28 |
return False
|
29 |
except LibsndfileError:
|
30 |
return False
|