|
There are three decoding mode for UniASR model(fast、normal、offline),for more model detailes, please refer to UniASR If you want to decode in fast mode from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
inference_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model='damo/speech_UniASR_asr_2pass-minnan-16k-common-vocab3825',
param_dict={"decoding_model": "fast"})
rec_result = inference_pipeline(audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav')
print(rec_result)If you want to decode in normal mode from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
inference_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model='damo/speech_UniASR_asr_2pass-minnan-16k-common-vocab3825',
param_dict={"decoding_model": "normal"})
rec_result = inference_pipeline(audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav')
print(rec_result)If you want to decode in offline mode from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
inference_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model='damo/speech_UniASR_asr_2pass-minnan-16k-common-vocab3825',
param_dict={"decoding_model": "offline"})
rec_result = inference_pipeline(audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav')
print(rec_result) |
Replies: 3 comments
|
Great job! but I test the model's rtf is slower than the paramform model, Do we have the plan to update to paramform model? |
|
I ran the above code and got an error Environment: Can you help me? give me your environments information. |
|
The Choose one mode when constructing the pipeline: from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
mode = "normal" # "fast", "normal", or "offline"
inference_pipeline = pipeline(
task=Tasks.auto_speech_recognition,
model="damo/speech_UniASR_asr_2pass-minnan-16k-common-vocab3825",
param_dict={"decoding_model": mode},
)
result = inference_pipeline(audio_in="asr_example.wav")
print(result)Create a new pipeline if you need to change the mode. The decoder/beam-search state is initialized for the selected mode. The modes mean:
The registry error reported above is a version mismatch, not an invalid I reproduced and verified the original API on CPU with this isolated environment: Using the official model snapshot and its bundled sample, all three independently constructed pipelines returned: Use a separate Python 3.9 environment for this legacy checkpoint rather than downgrading a current FunASR environment. A simple current Regarding RTF: UniASR combines streaming and non-streaming paths, and |
The
decoding_modelparameter in the original example is correct, but that example belongs to the legacy ModelScope/FunASR stack used by this 2023 model card.Choose one mode when constructing the pipeline:
Create a new pipeline if you need to change the mode. The decoder/beam-search state is initialized…