mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 15:19:59 +08:00
Update utils.py
fixed random error on DPO
This commit is contained in:
parent
0b806dba37
commit
d2f991bb6d
@ -209,7 +209,7 @@ def make_reject_y(y_o, y_lens):
|
|||||||
reject_y = []
|
reject_y = []
|
||||||
reject_y_lens = []
|
reject_y_lens = []
|
||||||
for b in range(bs):
|
for b in range(bs):
|
||||||
process_item_idx = torch.randint(0, 1, size=(1, ))[0]
|
process_item_idx = torch.randint(0, 2, size=(1, ))[0]
|
||||||
if process_item_idx == 0:
|
if process_item_idx == 0:
|
||||||
new_y = repeat_P(y_o[b])
|
new_y = repeat_P(y_o[b])
|
||||||
reject_y.append(new_y)
|
reject_y.append(new_y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user