mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-04-29 21:00:42 +08:00
Merge edc9ef99adef0ad0bc98c39f7840529d5af1c8a7 into 647935357a9637706fd2ec787fc9f7718370f4a2
This commit is contained in:
commit
8dc816480c
@ -553,6 +553,10 @@ class Text2SemanticDecoder(nn.Module):
|
||||
mask=xy_attn_mask,
|
||||
)
|
||||
logits = self.ar_predict_layer(xy_dec[:, -1])
|
||||
|
||||
eos_penalty = 2.0
|
||||
logits[:, self.EOS] -= eos_penalty
|
||||
|
||||
samples = topk_sampling(logits, top_k=top_k, top_p=1.0, temperature=temperature)
|
||||
|
||||
if early_stop_num != -1 and (y.shape[1] - prefix_len) > early_stop_num:
|
||||
@ -705,6 +709,9 @@ class Text2SemanticDecoder(nn.Module):
|
||||
xy_dec, k_cache, v_cache = self.t2s_transformer.decode_next_token(xy_pos, k_cache, v_cache, attn_mask)
|
||||
logits = self.ar_predict_layer(xy_dec[:, -1])
|
||||
|
||||
eos_penalty = 2.0
|
||||
logits[:, self.EOS] -= eos_penalty
|
||||
|
||||
if idx == 0:
|
||||
attn_mask = F.pad(attn_mask[:, :, -1].unsqueeze(-2), (0, 1), value=False)
|
||||
else:
|
||||
@ -895,6 +902,9 @@ class Text2SemanticDecoder(nn.Module):
|
||||
|
||||
logits = self.ar_predict_layer(xy_dec[:, -1])
|
||||
|
||||
eos_penalty = 2.0
|
||||
logits[:, self.EOS] -= eos_penalty
|
||||
|
||||
if idx == 0:
|
||||
xy_attn_mask = None
|
||||
if idx < 11: ###至少预测出10个token不然不给停止(0.4s)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user