mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-05-15 16:29:05 +08:00
Format code (#221)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
ccf6e6bbd2
commit
6726af00cf
8
gui.py
8
gui.py
@ -133,7 +133,9 @@ class RVC:
|
|||||||
score, ix = index.search(npy, k=8)
|
score, ix = index.search(npy, k=8)
|
||||||
weight = np.square(1 / score)
|
weight = np.square(1 / score)
|
||||||
weight /= weight.sum(axis=1, keepdims=True)
|
weight /= weight.sum(axis=1, keepdims=True)
|
||||||
npy = np.sum(big_npy[ix] * np.expand_dims(weight, axis=2), axis=1).astype("float16")
|
npy = np.sum(big_npy[ix] * np.expand_dims(weight, axis=2), axis=1).astype(
|
||||||
|
"float16"
|
||||||
|
)
|
||||||
|
|
||||||
feats = (
|
feats = (
|
||||||
torch.from_numpy(npy).unsqueeze(0).to(device) * self.index_rate
|
torch.from_numpy(npy).unsqueeze(0).to(device) * self.index_rate
|
||||||
@ -211,9 +213,7 @@ class GUI:
|
|||||||
title=i18n("加载模型"),
|
title=i18n("加载模型"),
|
||||||
layout=[
|
layout=[
|
||||||
[
|
[
|
||||||
sg.Input(
|
sg.Input(default_text="hubert_base.pt", key="hubert_path"),
|
||||||
default_text="hubert_base.pt", key="hubert_path"
|
|
||||||
),
|
|
||||||
sg.FileBrowse(i18n("Hubert模型")),
|
sg.FileBrowse(i18n("Hubert模型")),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user