mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-05 01:10:22 +08:00
chore(format): run black on dev (#2)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6ff713c024
commit
e2fcbff1e9
@@ -6,6 +6,7 @@ from onnx.f0predictor import PMF0Predictor
|
||||
from onnx.f0predictor import HarvestF0Predictor
|
||||
from onnx.f0predictor import DioF0Predictor
|
||||
|
||||
|
||||
class ContentVec:
|
||||
def __init__(self, vec_path: str, device=None):
|
||||
if device == "cpu" or device is None:
|
||||
@@ -30,12 +31,14 @@ class ContentVec:
|
||||
logits = self.model.run(None, onnx_input)[0]
|
||||
return logits.transpose(0, 2, 1)
|
||||
|
||||
|
||||
predicters = {
|
||||
"pm": PMF0Predictor,
|
||||
"harvest": HarvestF0Predictor,
|
||||
"dio": DioF0Predictor,
|
||||
}
|
||||
|
||||
|
||||
def get_f0_predictor(f0_method, hop_length, sampling_rate):
|
||||
return predicters[f0_method](hop_length=hop_length, sampling_rate=sampling_rate)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ f0_up_key = 0 # 升降调
|
||||
sid = 0 # 角色ID
|
||||
f0_method = "dio" # F0提取算法
|
||||
model_path = "exported_model.onnx" # 模型的完整路径
|
||||
vec_path = "vec-256-layer-9.onnx" # 需要onnx的vec模型
|
||||
vec_path = "vec-256-layer-9.onnx" # 需要onnx的vec模型
|
||||
wav_path = "123.wav" # 输入路径或ByteIO实例
|
||||
out_path = "out.wav" # 输出路径或ByteIO实例
|
||||
|
||||
|
||||
Reference in New Issue
Block a user