mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2024-12-29 19:15:04 +08:00
chore(format): run black on dev (#1763)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
3b2a1d081c
commit
35c83e88df
@ -530,7 +530,10 @@ if __name__ == "__main__":
|
|||||||
self.gui_config.sg_hostapi = self.hostapis[0]
|
self.gui_config.sg_hostapi = self.hostapis[0]
|
||||||
self.window["sg_hostapi"].Update(values=self.hostapis)
|
self.window["sg_hostapi"].Update(values=self.hostapis)
|
||||||
self.window["sg_hostapi"].Update(value=self.gui_config.sg_hostapi)
|
self.window["sg_hostapi"].Update(value=self.gui_config.sg_hostapi)
|
||||||
if self.gui_config.sg_input_device not in self.input_devices and len(self.input_devices) > 0:
|
if (
|
||||||
|
self.gui_config.sg_input_device not in self.input_devices
|
||||||
|
and len(self.input_devices) > 0
|
||||||
|
):
|
||||||
self.gui_config.sg_input_device = self.input_devices[0]
|
self.gui_config.sg_input_device = self.input_devices[0]
|
||||||
self.window["sg_input_device"].Update(values=self.input_devices)
|
self.window["sg_input_device"].Update(values=self.input_devices)
|
||||||
self.window["sg_input_device"].Update(
|
self.window["sg_input_device"].Update(
|
||||||
|
@ -375,14 +375,20 @@ class RVC:
|
|||||||
if (ix >= 0).all():
|
if (ix >= 0).all():
|
||||||
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(self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1)
|
npy = np.sum(
|
||||||
|
self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1
|
||||||
|
)
|
||||||
if self.config.is_half:
|
if self.config.is_half:
|
||||||
npy = npy.astype("float16")
|
npy = npy.astype("float16")
|
||||||
feats[0][skip_head // 2 :] = (
|
feats[0][skip_head // 2 :] = (
|
||||||
torch.from_numpy(npy).unsqueeze(0).to(self.device) * self.index_rate
|
torch.from_numpy(npy).unsqueeze(0).to(self.device)
|
||||||
|
* self.index_rate
|
||||||
+ (1 - self.index_rate) * feats[0][skip_head // 2 :]
|
+ (1 - self.index_rate) * feats[0][skip_head // 2 :]
|
||||||
)
|
)
|
||||||
else: printt("Invalid index. You MUST use added_xxxx.index but not trained_xxxx.index!")
|
else:
|
||||||
|
printt(
|
||||||
|
"Invalid index. You MUST use added_xxxx.index but not trained_xxxx.index!"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
printt("Index search FAILED or disabled")
|
printt("Index search FAILED or disabled")
|
||||||
except:
|
except:
|
||||||
|
Loading…
Reference in New Issue
Block a user