mirror of
https://github.com/wassname/TTS.git
synced 2026-09-09 11:16:00 +08:00
Use the last attention value as a threshold to stop decoding. since stoptoken prediction is not precies enough to synthsis at the right time.
This commit is contained in:
+1
-1
@@ -434,7 +434,7 @@ class Decoder(nn.Module):
|
||||
if t >= T_decoder:
|
||||
break
|
||||
else:
|
||||
if t > inputs.shape[1] / 4 and stop_token > 0.6:
|
||||
if t > inputs.shape[1] / 4 and (stop_token > 0.6 or attention[:, -1].item() > 0.6):
|
||||
break
|
||||
elif t > self.max_decoder_steps:
|
||||
print(" | > Decoder stopped with 'max_decoder_steps")
|
||||
|
||||
Reference in New Issue
Block a user