SenseVoice-python: A enterprise-grade open source multi-language asr system from funasr opensource with onnxruntime
Project description
SenseVoice-python with onnx
SenseVoice是阿里开源的多语言asr.
使用方式
安装
pip install sensevoice-onnx
# or pip from github
pip install git+https://github.com/lovemefan/SenseVoice-python.git
使用
sensevoice --audio sensevoice/resource/asr_example_zh.wav
第一次使用会自动从huggingface下载,如果下载不下来,可以使用镜像
- Linux:
export HF_ENDPOINT=https://hf-mirror.com
- Windows Powershell
$env:HF_ENDPOINT = "https://hf-mirror.com"
* ```
或者非入侵方式使用环境变量
```bash
HF_ENDPOINT=https://hf-mirror.com sensevoice --audio sensevoice/resource/asr_example_zh.wav
Sense Voice 脚本参数设置
optional arguments:
-h, --help show this help message and exit
-a , --audio_file 设置音频路径
-dp , --download_path 自定义模型下载路径,默认`sensevoice/resource`
-d , --device, 使用cpu时为-1,使用gpu(需要安装onnxruntime-gpu)时指定卡号 默认`-1`
Device
-n , --num_threads , 线程数, 默认 `4`
Num threads
-l , --language {auto,zh,en,yue,ja,ko,nospeech} 语音代码,默认`auto`
--use_itn 是否使用itn
--use_int8 是否使用int8 量化的onnx模型
结果
2024-07-19 14:16:41,522 INFO [sense_voice_ort_session.py:130] Loading model from /Users/cenglingfan/Code/python-project/SenseVoice-python/sensevoice/resource/embedding.npy
2024-07-19 14:16:41,525 INFO [sense_voice_ort_session.py:133] Loading model /Users/cenglingfan/Code/python-project/SenseVoice-python/sensevoice/resource/sense-voice-encoder.onnx
2024-07-19 14:16:43,994 INFO [sense_voice_ort_session.py:140] Loading /Users/cenglingfan/Code/python-project/SenseVoice-python/sensevoice/resource/embedding.npy takes 2.47 seconds
2024-07-19 14:16:44,031 INFO [sense_voice.py:76] Audio resource/asr_example_zh.wav is 5.58 seconds
2024-07-19 14:16:44,253 INFO [sense_voice.py:81] <|zh|><|NEUTRAL|><|Speech|><|woitn|>欢迎大家来体验达摩院推出的语音识别模型
2024-07-19 14:16:44,253 INFO [sense_voice.py:83] Decoder audio takes 0.22162580490112305 seconds
2024-07-19 14:16:44,253 INFO [sense_voice.py:84] The RTF is 0.03971788618299696.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sensevoice-onnx-1.0.0.tar.gz
(8.4 kB
view details)
Built Distribution
File details
Details for the file sensevoice-onnx-1.0.0.tar.gz
.
File metadata
- Download URL: sensevoice-onnx-1.0.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49ccb7f383bbce1159914bc5d571aa0101fd0f14eb7b6dd93bd6c7ce2d5fac53 |
|
MD5 | c59273f29d5f81c02a397a224f4ad483 |
|
BLAKE2b-256 | 45b306833d064afb3d3ec68a4bf0d2ebde7e19dbe9d6bb23fa7cb3a9b94da290 |
File details
Details for the file sensevoice_onnx-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: sensevoice_onnx-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79042b3a957fb60e1ff5ac4035b989000d6ca8ab72db614bd2e7dde6969e01de |
|
MD5 | dc139cb424a0122677cc577e7283da79 |
|
BLAKE2b-256 | d2b0be02488a4189e644ce53746336087d6249587b47c9f750e09789c1c874d9 |