1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-08 20:10:44 +08:00

fix(web): unload model error

IndexError: tuple index out of range
This commit is contained in:
源文雨
2024-06-03 16:07:03 +09:00
parent 17e703a9ad
commit ccecac6133
5 changed files with 41 additions and 31 deletions

View File

@@ -253,7 +253,10 @@ class Pipeline(object):
# _, I = index.search(npy, 1)
# npy = big_npy[I.squeeze()]
score, ix = index.search(npy, k=8)
try:
score, ix = index.search(npy, k=8)
except:
raise Exception("index mistatch")
weight = np.square(1 / score)
weight /= weight.sum(axis=1, keepdims=True)
npy = np.sum(big_npy[ix] * np.expand_dims(weight, axis=2), axis=1)