File size: 658 Bytes
3f25a55
 
 
 
 
 
 
 
 
 
 
217011e
3f25a55
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from os.path import join as p_join
from glob import glob
from tqdm import tqdm

direction = os.getenv("DIRECTION", "enA-jaA")
cache_dir_audio = p_join("download", "audio", direction)
cache_dir_feature = p_join("download", "feature", direction)
line_no_start = int(os.getenv("LINE_NO_START", 0))
line_no_end = int(os.getenv("LINE_NO_END", 10000))
for i in tqdm(range(line_no_start, line_no_end), total=line_no_end-line_no_start):
    for audio_file in glob(p_join(cache_dir_audio, "*", f"{i}.*")):
        os.remove(audio_file)
    if os.path.exists(p_join(cache_dir_feature, f"{i}.json")):
        os.remove(p_join(cache_dir_feature, f"{i}.json"))