Download code/gen_filelist.py from rcell233/magvits_data: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/rcell233/magvits_data/resolve/main/code/gen_filelist.py
- Command line
-
hf download hf://datasets/rcell233/magvits_data/code/gen_filelist.py
-
curl -L -o gen_filelist.py https://huggingface.co/datasets/rcell233/magvits_data/resolve/main/code/gen_filelist.py
1.07 kB
| # from glob import glob | |
| # from random import shuffle | |
| # from data_conf import data_root | |
| # from tqdm import tqdm | |
| # import os | |
| # filenames = glob(f"{data_root}/**/*.wav", recursive=True) # [:10] | |
| # filenames += glob(f"{data_root}/**/*.mp3", recursive=True) # [:10] | |
| # filenames = [f for f in tqdm(filenames)] | |
| # shuffle(filenames) | |
| # val_num = 4 | |
| # print(len(filenames)) | |
| # train = filenames[:-val_num] | |
| # val = filenames[-val_num:] | |
| # train.sort() | |
| # val.sort() | |
| # with open('dump/train_files.list', 'w') as f: | |
| # f.write('\n'.join(train)) | |
| # with open('dump/val_files.list', 'w') as f: | |
| # f.write('\n'.join(val)) | |
| # with open('dump/train_files.list','w') as f: | |
| # train_files = open('dump/train_files copy.list').readlines() | |
| # train_files = [f.strip() for f in train_files if 'wenet' not in f] | |
| # f.write('\n'.join(train_files)) | |
| import glob | |
| in_dir = '/mnt/ttsa3/users/yijin.xing/wave_vaegan/eval_data' | |
| tgt_path = 'dump/eval_files.list' | |
| all_wavs = glob.glob(f'{in_dir}/**/*.wav', recursive=True) | |
| with open(tgt_path, 'w') as f: | |
| f.write('\n'.join(all_wavs)) |