From fbda348b9a722ab03fcaa2c6252925516823166b Mon Sep 17 00:00:00 2001 From: VSlobolinskyi Date: Tue, 18 Mar 2025 11:07:41 +0200 Subject: [PATCH] Accept global definition --- infer/modules/vc/modules.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infer/modules/vc/modules.py b/infer/modules/vc/modules.py index 2089070..96db6a7 100644 --- a/infer/modules/vc/modules.py +++ b/infer/modules/vc/modules.py @@ -17,7 +17,8 @@ from infer.lib.infer_pack.models import ( ) from infer.modules.vc.pipeline import Pipeline from infer.modules.vc.utils import * - +from fairseq.data.dictionary import Dictionary +import torch class VC: def __init__(self, config): @@ -169,7 +170,8 @@ class VC: times = [0, 0, 0] if self.hubert_model is None: - self.hubert_model = load_hubert(self.config) + with torch.serialization.safe_globals({"fairseq.data.dictionary.Dictionary": Dictionary}): + self.hubert_model = load_hubert(self.config) if file_index: file_index = (