[Hackathon 7th] 修复不存在 `*.npy` 文件的空文件夹导致的数据遍历错误 (#3948)

* [Fix] empty npy folder

* [Update] assert empyt folder
pull/3960/head
megemini 8 months ago committed by GitHub
parent 0ef3cfca31
commit 7d26f93d2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -39,7 +39,12 @@ class MultiSpeakerMelDataset(Dataset):
def __init__(self, dataset_root: Path):
self.root = Path(dataset_root).expanduser()
speaker_dirs = [f for f in self.root.glob("*") if f.is_dir()]
speaker_dirs = []
for f in self.root.glob("*"):
if f.is_dir():
assert list(f.glob(
"*.npy")), "This folder NOT includes any npy data file."
speaker_dirs.append(f)
speaker_utterances = {
speaker_dir: list(speaker_dir.glob("*.npy"))

Loading…
Cancel
Save