Skip to content

Commit

Permalink
add postprocess for sensevoice
Browse files Browse the repository at this point in the history
  • Loading branch information
Lizerui9926 committed Jul 10, 2024
1 parent 771252c commit 831cd02
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ print(res)

```python
from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall"
input_file = (
Expand All @@ -137,7 +138,9 @@ res = model.generate(
batch_size_s=0,
)

print(res)
text = rich_transcription_postprocess(res[0]["text"])

print(text)
```

The funasr version has integrated the VAD (Voice Activity Detection) model and supports audio input of any duration, with `batch_size_s` in seconds.
Expand Down
5 changes: 4 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ print(res)

```python
from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall"
input_file = (
Expand All @@ -137,7 +138,9 @@ res = model.generate(
batch_size_s=0,
)

print(res)
text = rich_transcription_postprocess(res[0]["text"])

print(text)
```

funasr版本已经集成了vad模型,支持任意时长音频输入,`batch_size_s`单位为秒。
Expand Down
5 changes: 4 additions & 1 deletion demo_funasr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# MIT License (https://opensource.org/licenses/MIT)

from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess

model_dir = "iic/SenseVoiceSmall"
input_file = (
Expand All @@ -22,4 +23,6 @@
use_itn=False,
)

print(res)
text = rich_transcription_postprocess(res[0]["text"])

print(text)

0 comments on commit 831cd02

Please sign in to comment.