Skip to content

How to use Parafomrer model for streaming #241

Answered by hnluo
LauraGPT asked this question in Q&A
Discussion options

You must be logged in to vote

How to use Paraformer model for streaming decoding

import os
import logging
import torch
import soundfile

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.utils.logger import get_logger

logger = get_logger(log_level=logging.CRITICAL)
logger.setLevel(logging.CRITICAL)

os.environ["MODELSCOPE_CACHE"] = "./"
inference_pipeline = pipeline(
    task=Tasks.auto_speech_recognition,
    model='damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online',
    model_revision='v1.0.6',
    update_model=False,
    mode="paraformer_streaming"
)

model_dir = os.path.join(os.environ["MODELSCOPE_CACHE"], "damo/speech_paraformer-large_asr_n…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Mewral
Comment options

Answer selected by LauraGPT
Comment options

You must be logged in to vote
1 reply
@ai-charlie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants