From 4dcdc18656d48d7b8b097eff4083491581df1107 Mon Sep 17 00:00:00 2001 From: ButterCream <56580073+korakoe@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:14:39 +0800 Subject: [PATCH 1/4] Prevent iterating over already quantized data --- vall_e/emb/qnt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vall_e/emb/qnt.py b/vall_e/emb/qnt.py index e0efd72..8862b0b 100644 --- a/vall_e/emb/qnt.py +++ b/vall_e/emb/qnt.py @@ -83,13 +83,18 @@ def main(): paths = [*args.folder.rglob(f"*{args.suffix}")] random.shuffle(paths) + for idx, path in tqdm(enumerate(paths)): + out_path = _replace_file_extension(path, ".qnt.pt") + if out_path.exists(): + paths.pop(idx) + for path in tqdm(paths): out_path = _replace_file_extension(path, ".qnt.pt") if out_path.exists(): continue qnt = encode_from_file(path) torch.save(qnt.cpu(), out_path) - + del qnt if __name__ == "__main__": main() From 83ba50f0e560b49389ee8ebd99f4084e3e177642 Mon Sep 17 00:00:00 2001 From: ButterCream <56580073+korakoe@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:16:49 +0800 Subject: [PATCH 2/4] forgot to remove check --- vall_e/emb/qnt.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/vall_e/emb/qnt.py b/vall_e/emb/qnt.py index 8862b0b..c8436f5 100644 --- a/vall_e/emb/qnt.py +++ b/vall_e/emb/qnt.py @@ -90,11 +90,8 @@ def main(): for path in tqdm(paths): out_path = _replace_file_extension(path, ".qnt.pt") - if out_path.exists(): - continue qnt = encode_from_file(path) torch.save(qnt.cpu(), out_path) - del qnt if __name__ == "__main__": main() From 0c72764c4ecf012a8fd9cd3a0229ce4a58f3c774 Mon Sep 17 00:00:00 2001 From: ButterCream <56580073+korakoe@users.noreply.github.com> Date: Thu, 13 Apr 2023 15:08:02 +0800 Subject: [PATCH 3/4] Fix forked sub-process errors --- vall_e/train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vall_e/train.py b/vall_e/train.py index 5f819c4..bfb2861 100644 --- a/vall_e/train.py +++ b/vall_e/train.py @@ -125,4 +125,5 @@ def eval_fn(engines): if __name__ == "__main__": + torch.multiprocessing.set_start_method("spawn") main() From 43c8eae9e8a36be6125396b268482e55d02c5ac3 Mon Sep 17 00:00:00 2001 From: ButterCream <56580073+korakoe@users.noreply.github.com> Date: Thu, 13 Apr 2023 15:23:13 +0800 Subject: [PATCH 4/4] undo last commit --- vall_e/train.py | 1 - 1 file changed, 1 deletion(-) diff --git a/vall_e/train.py b/vall_e/train.py index bfb2861..5f819c4 100644 --- a/vall_e/train.py +++ b/vall_e/train.py @@ -125,5 +125,4 @@ def eval_fn(engines): if __name__ == "__main__": - torch.multiprocessing.set_start_method("spawn") main()