Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
funasr_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 480aa03b
authored
Apr 26, 2024
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加测试文件
1 parent
bfed35a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
test01.py
test04.py
test01.py
View file @
480aa03
...
@@ -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
=
"iic/speech_paraformer-large-vad-punc-spk_asr_nat-zh-cn"
,
model
=
"iic/speech_paraformer-large-vad-punc-spk_asr_nat-zh-cn"
,
...
@@ -13,9 +15,10 @@ model = AutoModel(
...
@@ -13,9 +15,10 @@ 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_campplus_speaker-diarization_common"
,
# spk_model="iic/speech_eres2net_sv_zh-cn_16k-common",
spk_model_revision
=
"v1.0.0"
,
# spk_model="iic/speech_campplus_speaker-diarization_common",
# 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",
ncpu
=
8
,
ncpu
=
8
,
...
...
test04.py
0 → 100644
View file @
480aa03
# 版本要求 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
)
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment