代码如下:from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
model = AutoModel(
model='/home/model/u8_model',
trust_remote_code=True,
remote_code="/home/model/model.py",
vad_kwargs={"max_single_segment_time": 10000},
device="npu:0",
disable_update=True
)
========== 正式推理计时 ==========
start = time.time()
res = model.generate(
input='/root/C_JSSR055116_20241016102013_18079131618_otalk.wav',
cache={},
language="zh",
use_itn=True,
batch_size_s=30,
merge_length_s=30,
)
end = time.time()
text = rich_transcription_postprocess(res[0]["text"])
print(text)
print(f"耗时: {end - start:.2f} 秒")
代码如下:from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
model = AutoModel(
model='/home/model/u8_model',
trust_remote_code=True,
remote_code="/home/model/model.py",
vad_kwargs={"max_single_segment_time": 10000},
device="npu:0",
disable_update=True
)
========== 正式推理计时 ==========
start = time.time()
res = model.generate(
input='/root/C_JSSR055116_20241016102013_18079131618_otalk.wav',
cache={},
language="zh",
use_itn=True,
batch_size_s=30,
merge_length_s=30,
)
end = time.time()
text = rich_transcription_postprocess(res[0]["text"])
print(text)
print(f"耗时: {end - start:.2f} 秒")