mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-09-29 08:49:59 +08:00
feat:optimize looping
This commit is contained in:
parent
5c08328cf3
commit
71cbe28e68
@ -105,7 +105,7 @@ sdec = ort.InferenceSession(MODEL_PATH+"_export_t2s_sdec.onnx")
|
|||||||
"prompts": prompts
|
"prompts": prompts
|
||||||
})
|
})
|
||||||
|
|
||||||
early_stop_num = -1
|
|
||||||
prefix_len = prompts.shape[1]
|
prefix_len = prompts.shape[1]
|
||||||
|
|
||||||
stop = False
|
stop = False
|
||||||
@ -118,11 +118,7 @@ for idx in tqdm(range(1, 1500)):
|
|||||||
"iy_emb": y_emb,
|
"iy_emb": y_emb,
|
||||||
"ix_example": x_example
|
"ix_example": x_example
|
||||||
})
|
})
|
||||||
if early_stop_num != -1 and (y.shape[1] - prefix_len) > early_stop_num:
|
if np.argmax(logits, axis=-1)[0] == 1024 or samples[0, 0] == 1024: # 1024 is the EOS token
|
||||||
stop = True
|
|
||||||
if np.argmax(logits, axis=-1)[0] == 1024 or samples[0, 0] == 1024:
|
|
||||||
stop = True
|
|
||||||
if stop:
|
|
||||||
break
|
break
|
||||||
y[0, -1] = 0
|
y[0, -1] = 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user