From a62ef27d71b7aa35fb8603cbbbafabaefffeb2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E6=B5=A9?= Date: Mon, 30 Sep 2024 14:48:05 +0800 Subject: [PATCH] convert omega dict to dict --- funasr/models/extract_tokens/model.py | 4 ++++ funasr/models/sense_voice/model_small.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/funasr/models/extract_tokens/model.py b/funasr/models/extract_tokens/model.py index 16fe5aaa0..e383f0d44 100644 --- a/funasr/models/extract_tokens/model.py +++ b/funasr/models/extract_tokens/model.py @@ -1088,6 +1088,8 @@ class SenseVoiceQuantizedEncoderPitch(nn.Module): def build_quantizer(self, vq_config): if vq_config is None: return None + from omegaconf import OmegaConf, DictConfig + vq_config = OmegaConf.to_container(vq_config) name = vq_config.pop("name", "costume_quantizer") if name == "costume_quantizer": from funasr.models.sense_voice.quantizer.costume_quantizer import CostumeQuantizer @@ -1236,6 +1238,8 @@ class SenseVoiceQuantizedEncoder(nn.Module): def build_quantizer(self, vq_config): if vq_config is None: return None + from omegaconf import OmegaConf, DictConfig + vq_config = OmegaConf.to_container(vq_config) name = vq_config.pop("name", "costume_quantizer") if name == "costume_quantizer": from funasr.models.sense_voice.quantizer.costume_quantizer import CostumeQuantizer diff --git a/funasr/models/sense_voice/model_small.py b/funasr/models/sense_voice/model_small.py index e2b2f361f..535cc19ce 100644 --- a/funasr/models/sense_voice/model_small.py +++ b/funasr/models/sense_voice/model_small.py @@ -2027,7 +2027,7 @@ class SenseVoiceLPitch(nn.Module): if self.activation_checkpoint: from torch.utils.checkpoint import checkpoint - encoder_out, encoder_out_lens = checkpoint( + encoder_out, encoder_f0_out, encoder_out_lens = checkpoint( self.encode, speech, speech_lengths, use_reentrant=False ) else: