Skip exists
This commit is contained in:
parent
45fc310876
commit
8edaa36f2f
@ -1,4 +1,5 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
import random
|
||||||
from functools import cache
|
from functools import cache
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@ -73,9 +74,12 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
paths = [*args.folder.rglob(f"*{args.suffix}")]
|
paths = [*args.folder.rglob(f"*{args.suffix}")]
|
||||||
|
random.shuffle(paths)
|
||||||
|
|
||||||
for path in tqdm(paths):
|
for path in tqdm(paths):
|
||||||
out_path = _replace_file_extension(path, ".qnt.pt")
|
out_path = _replace_file_extension(path, ".qnt.pt")
|
||||||
|
if out_path.exists():
|
||||||
|
continue
|
||||||
wav, sr = torchaudio.load(path)
|
wav, sr = torchaudio.load(path)
|
||||||
if wav.shape[0] == 2:
|
if wav.shape[0] == 2:
|
||||||
wav = wav[:1]
|
wav = wav[:1]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user