From 586287df30218ebe873a18222d6a9b53d7860c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=B8=E9=9B=81?= Date: Tue, 16 Jul 2024 16:34:25 +0800 Subject: [PATCH] sensevoice --- README.md | 4 ++-- README_zh.md | 4 ++-- demo2.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 334b292..1164fb1 100644 --- a/README.md +++ b/README.md @@ -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) ``` diff --git a/README_zh.md b/README_zh.md index d0a7613..be7f67d 100644 --- a/README_zh.md +++ b/README_zh.md @@ -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) ``` diff --git a/demo2.py b/demo2.py index e97e48d..c9dfae7 100644 --- a/demo2.py +++ b/demo2.py @@ -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)