update scripts

This commit is contained in:
shixian.shi 2024-01-15 20:25:35 +08:00
parent 55c09aeaa2
commit 3fcb5dcfed
2 changed files with 3 additions and 6 deletions

View File

@ -12,7 +12,7 @@ model = AutoModel(model="damo/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-co
punc_model="damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
punc_model_revision="v2.0.2",
spk_model="damo/speech_campplus_sv_zh-cn_16k-common",
spk_model="v2.0.2",
spk_model_revision="v2.0.2",
)
res = model(input=f"{model.model_path}/example/asr_example.wav",

View File

@ -274,12 +274,9 @@ class AutoModel:
def generate_with_vad(self, input, input_len=None, **cfg):
# step.1: compute the vad model
model = self.vad_model
kwargs = self.vad_kwargs
kwargs.update(cfg)
self.vad_kwargs.update(cfg)
beg_vad = time.time()
res = self.generate(input, input_len=input_len, model=model, kwargs=kwargs, **cfg)
vad_res = res
res = self.generate(input, input_len=input_len, model=self.vad_model, kwargs=self.vad_kwargs, **cfg)
end_vad = time.time()
print(f"time cost vad: {end_vad - beg_vad:0.3f}")