Skip to content

SOTA Open Source TTS

Fix stop gradient

Lengyuec08afee273a9
diff --git a/fish_speech/configs/vqgan_pretrain.yaml b/fish_speech/configs/vqgan_pretrain.yaml
index 8210657..86eb33f 100644
--- a/fish_speech/configs/vqgan_pretrain.yaml
+++ b/fish_speech/configs/vqgan_pretrain.yaml
@@ -11,7 +11,7 @@ trainer:
precision: bf16-mixed
max_steps: 1_000_000
val_check_interval: 1000
- strategy: ddp_find_unused_parameters_true
+ strategy: ddp
sample_rate: 44100
hop_length: 512
diff --git a/fish_speech/models/vqgan/lit_module.py b/fish_speech/models/vqgan/lit_module.py
index 7c718ec..9bb7221 100644
--- a/fish_speech/models/vqgan/lit_module.py
+++ b/fish_speech/models/vqgan/lit_module.py
@@ -148,7 +148,7 @@ class VQGAN(L.LightningModule):
v_pred = self.reflow(
x_t,
1000 * t,
- vq_recon_features,
+ vq_recon_features.detach(), # Stop gradients, avoid reflow to destroy the VQ
)
# Log L2 loss with