SOTA Open Source TTS
fix(tools/vqgan): resample on the codec's device instead of hardcoded CUDA (#1339)
li-lizhed19f82fae427
diff --git a/tools/vqgan/extract_vq.py b/tools/vqgan/extract_vq.pyindex e1c743e..54c9d5e 100644--- a/tools/vqgan/extract_vq.py+++ b/tools/vqgan/extract_vq.py@@ -105,7 +105,9 @@ def process_batch(files: list[Path], model) -> float:if wav.shape[0] > 1:wav = wav.mean(dim=0, keepdim=True)- wav = torchaudio.functional.resample(wav.cuda(), sr, model.sample_rate)[0]+ wav = torchaudio.functional.resample(+ wav.to(model.device), sr, model.sample_rate+ )[0]total_time += len(wav) / model.sample_ratemax_length = max(max_length, len(wav))