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

fix(fairseq): hubert load model error

This commit is contained in:
源文雨
2026-04-18 19:04:13 +08:00
parent 8ded36e9e1
commit f9ae0b5d32
12 changed files with 101 additions and 151 deletions

View File

@@ -10,9 +10,6 @@ from pybase16384 import encode_to_string, decode_from_string
from configs import CPUConfig
from rvc.synthesizer import get_synthesizer
from .pipeline import Pipeline
from .utils import load_hubert
class TorchSeedContext:
def __init__(self, seed):
@@ -95,6 +92,9 @@ def wave_hash(time_field):
def model_hash(config, tgt_sr, net_g, if_f0, version):
from .pipeline import Pipeline
from .utils import load_hubert
pipeline = Pipeline(tgt_sr, config)
audio = original_audio()
hbt = load_hubert(config.device, config.is_half)

View File

@@ -1,6 +1,7 @@
import os, pathlib
from fairseq import checkpoint_utils
import torch
from fairseq import checkpoint_utils, data
def get_index_path_from_model(sid):
@@ -21,10 +22,11 @@ def get_index_path_from_model(sid):
def load_hubert(device, is_half):
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
["assets/hubert/hubert_base.pt"],
suffix="",
)
with torch.serialization.safe_globals([data.dictionary.Dictionary]):
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
["assets/hubert/hubert_base.pt"],
suffix="",
)
hubert_model = models[0]
hubert_model = hubert_model.to(device)
if is_half: