mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
update scripts
This commit is contained in:
parent
55c09aeaa2
commit
3fcb5dcfed
@ -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="damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch",
|
||||||
punc_model_revision="v2.0.2",
|
punc_model_revision="v2.0.2",
|
||||||
spk_model="damo/speech_campplus_sv_zh-cn_16k-common",
|
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",
|
res = model(input=f"{model.model_path}/example/asr_example.wav",
|
||||||
|
|||||||
@ -274,12 +274,9 @@ class AutoModel:
|
|||||||
def generate_with_vad(self, input, input_len=None, **cfg):
|
def generate_with_vad(self, input, input_len=None, **cfg):
|
||||||
|
|
||||||
# step.1: compute the vad model
|
# step.1: compute the vad model
|
||||||
model = self.vad_model
|
self.vad_kwargs.update(cfg)
|
||||||
kwargs = self.vad_kwargs
|
|
||||||
kwargs.update(cfg)
|
|
||||||
beg_vad = time.time()
|
beg_vad = time.time()
|
||||||
res = self.generate(input, input_len=input_len, model=model, kwargs=kwargs, **cfg)
|
res = self.generate(input, input_len=input_len, model=self.vad_model, kwargs=self.vad_kwargs, **cfg)
|
||||||
vad_res = res
|
|
||||||
end_vad = time.time()
|
end_vad = time.time()
|
||||||
print(f"time cost vad: {end_vad - beg_vad:0.3f}")
|
print(f"time cost vad: {end_vad - beg_vad:0.3f}")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user