Skip to content

Commit 751333f

Browse files
committed
docs
1 parent dfe6e6a commit 751333f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,13 @@ from funasr.utils.postprocess_utils import rich_transcription_postprocess
170170

171171
model_dir = "iic/SenseVoiceSmall"
172172
m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir, device="cuda:0")
173-
173+
m.eval()
174174

175175
res = m.inference(
176176
data_in=f"{kwargs['model_path']}/example/en.mp3",
177177
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
178178
use_itn=False,
179+
ban_emo_unk=False,
179180
**kwargs,
180181
)
181182

README_ja.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,13 @@ from funasr.utils.postprocess_utils import rich_transcription_postprocess
171171

172172
model_dir = "iic/SenseVoiceSmall"
173173
m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir, device="cuda:0")
174-
174+
m.eval()
175175

176176
res = m.inference(
177177
data_in=f"{kwargs['model_path']}/example/en.mp3",
178178
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
179179
use_itn=False,
180+
ban_emo_unk=False,
180181
**kwargs,
181182
)
182183

README_zh.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ print(text)
145145
- `use_itn`:输出结果中是否包含标点与逆文本正则化。
146146
- `batch_size_s` 表示采用动态batch,batch中总音频时长,单位为秒s。
147147
- `merge_vad`:是否将 vad 模型切割的短音频碎片合成,合并后长度为`merge_length_s`,单位为秒s。
148-
- `ban_emo_unk`:禁用emo_unk标签,禁用后所有的句子都会被赋与情感标签。
148+
- `ban_emo_unk`:禁用emo_unk标签,禁用后所有的句子都会被赋与情感标签。默认`False`
149149
</details>
150150

151151
如果输入均为短音频(小于30s),并且需要批量化推理,为了加快推理效率,可以移除vad模型,并设置`batch_size`
@@ -174,12 +174,13 @@ from funasr.utils.postprocess_utils import rich_transcription_postprocess
174174

175175
model_dir = "iic/SenseVoiceSmall"
176176
m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir, device="cuda:0")
177-
177+
m.eval()
178178

179179
res = m.inference(
180180
data_in=f"{kwargs['model_path']}/example/en.mp3",
181181
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
182182
use_itn=False,
183+
ban_emo_unk=False,
183184
**kwargs,
184185
)
185186

demo2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010
model_dir = "iic/SenseVoiceSmall"
1111
m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir, device="cuda:0")
12-
12+
m.eval()
1313

1414
res = m.inference(
1515
data_in=f"{kwargs['model_path']}/example/en.mp3",
1616
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
1717
use_itn=False,
18+
ban_emo_unk=False,
1819
**kwargs,
1920
)
2021

0 commit comments

Comments
 (0)