sensevoice

This commit is contained in:
游雁 2024-07-16 16:34:25 +08:00
parent 198048affa
commit 586287df30
3 changed files with 6 additions and 6 deletions

View File

@ -160,13 +160,13 @@ m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir)
res = m.inference(
data_in="https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav",
data_in=f"{kwargs['model_path']}/example/en.mp3",
language="auto", # "zn", "en", "yue", "ja", "ko", "nospeech"
use_itn=False,
**kwargs,
)
text = rich_transcription_postprocess(res[0]["text"])
text = rich_transcription_postprocess(res[0][0]["text"])
print(text)
```

View File

@ -164,13 +164,13 @@ m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir)
res = m.inference(
data_in="https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav",
data_in=f"{kwargs['model_path']}/example/en.mp3",
language="auto", # "zn", "en", "yue", "ja", "ko", "nospeech"
use_itn=False,
**kwargs,
)
text = rich_transcription_postprocess(res[0]["text"])
text = rich_transcription_postprocess(res[0][0]["text"])
print(text)
```

View File

@ -12,11 +12,11 @@ m, kwargs = SenseVoiceSmall.from_pretrained(model=model_dir)
res = m.inference(
data_in=f"{m.model_path}/example/en.mp3",
data_in=f"{kwargs['model_path']}/example/en.mp3",
language="auto", # "zn", "en", "yue", "ja", "ko", "nospeech"
use_itn=False,
**kwargs,
)
text = rich_transcription_postprocess(res[0]["text"])
text = rich_transcription_postprocess(res[0][0]["text"])
print(text)