Commit 328d38d0 by ‘chizw’

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	test01.py
2 parents 42283ff5 57fc0750
myvenv/ myvenv/
.vscode .vscode
__pycache__ __pycache__
*.MP3 # *.MP3
*.wav # *.wav
This file is too large to display.
No preview for this file type
No preview for this file type
本项目主要是提供接口给外部进行语音转文字
主要的功能类: main.py 提供http协议接口
funasr_service.py 提供语音转文字模型功能
kafka_service/funasr_consumer.py 提供kafka消费者功能
kafka_service/funasr_producer.py 提供kafka生产者功能
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,9 @@ import funasr_service ...@@ -5,7 +5,9 @@ import funasr_service
# paraformer-zh is a multi-functional asr model # paraformer-zh is a multi-functional asr model
# use vad, punc, spk or not as you need # use vad, punc, spk or not as you need
model = AutoModel( model = AutoModel(
# model="paraformer-zh", # model="paraformer-zh",
# model="paraformer-zh-spk", # model="paraformer-zh-spk",
model="c:/Users/chizw/.cache/modelscope/hub/iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-Common-vocab8404-pytorch", model="c:/Users/chizw/.cache/modelscope/hub/iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-Common-vocab8404-pytorch",
...@@ -14,9 +16,9 @@ model = AutoModel( ...@@ -14,9 +16,9 @@ model = AutoModel(
vad_model="fsmn-vad", vad_model="fsmn-vad",
# punc_model="ct-punc-c", # punc_model="ct-punc-c",
punc_model="ct-punc", punc_model="ct-punc",
# spk_model="cam++", spk_model="cam++",
spk_model="iic/speech_eres2net_sv_zh-cn_16k-common", # spk_model="iic/speech_eres2net_sv_zh-cn_16k-common",
# spk_model="cam++", # spk_model="iic/speech_campplus_speaker-diarization_common",
# spk_model_revision="v1.0.0", # spk_model_revision="v1.0.0",
# spk_model="iic/speech_eres2net-large_speaker-diarization_common", # spk_model="iic/speech_eres2net-large_speaker-diarization_common",
# openai_model="Whisper-large-v3", # openai_model="Whisper-large-v3",
......
# 版本要求 modelscope version 升级至最新版本 funasr 升级至最新版本
from modelscope.pipelines import pipeline
sd_pipeline = pipeline(
task="speaker-diarization",
model="damo/speech_campplus_speaker-diarization_common",
model_revision="v1.0.0",
)
input_wav = "https://modelscope.cn/api/v1/models/damo/speech_campplus_speaker-diarization_common/repo?Revision=master&FilePath=examples/2speakers_example.wav"
result = sd_pipeline(input_wav)
print(result)
# 如果有先验信息,输入实际的说话人数,会得到更准确的预测结果
result = sd_pipeline(input_wav, oracle_num=2)
print(result)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!