mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-01-01 13:47:57 +08:00
对齐naive_infer的解码策略,防止吞句 (#2697)
This commit is contained in:
parent
abe984395c
commit
bfca0f6b2d
@ -711,6 +711,9 @@ class Text2SemanticDecoder(nn.Module):
|
|||||||
else:
|
else:
|
||||||
attn_mask = F.pad(attn_mask, (0, 1), value=False)
|
attn_mask = F.pad(attn_mask, (0, 1), value=False)
|
||||||
|
|
||||||
|
if idx < 11: ###至少预测出10个token不然不给停止(0.4s)
|
||||||
|
logits = logits[:, :-1]
|
||||||
|
|
||||||
samples = sample(
|
samples = sample(
|
||||||
logits, y, top_k=top_k, top_p=top_p, repetition_penalty=repetition_penalty, temperature=temperature
|
logits, y, top_k=top_k, top_p=top_p, repetition_penalty=repetition_penalty, temperature=temperature
|
||||||
)[0]
|
)[0]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user