Update README.md
Browse files
README.md
CHANGED
@@ -3,25 +3,26 @@ license: apache-2.0
|
|
3 |
base_model:
|
4 |
- openai/whisper-base
|
5 |
pipeline_tag: automatic-speech-recognition
|
|
|
|
|
|
|
6 |
---
|
7 |
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
## Install onnx-asr
|
13 |
```shell
|
14 |
pip install onnx-asr[cpu,hub]
|
15 |
```
|
16 |
|
17 |
-
|
18 |
```py
|
19 |
import onnx_asr
|
20 |
model = onnx_asr.load_model("whisper-base")
|
21 |
print(model.recognize("test.wav"))
|
22 |
```
|
23 |
|
24 |
-
##
|
25 |
|
26 |
Read onnxruntime [instruction](https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/python/tools/transformers/models/whisper/README.md) for convert Whisper to ONNX.
|
27 |
|
@@ -36,12 +37,4 @@ from transformers import WhisperTokenizer
|
|
36 |
|
37 |
processor = WhisperTokenizer.from_pretrained("openai/whisper-base")
|
38 |
processor.save_pretrained("whisper-onnx")
|
39 |
-
```
|
40 |
-
|
41 |
-
Create `config.json`
|
42 |
-
```json
|
43 |
-
{
|
44 |
-
"model_type": "whisper-ort",
|
45 |
-
"features_size": 80
|
46 |
-
}
|
47 |
-
```
|
|
|
3 |
base_model:
|
4 |
- openai/whisper-base
|
5 |
pipeline_tag: automatic-speech-recognition
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
- ru
|
9 |
---
|
10 |
|
11 |
+
OpenAI Whisper base [model](https://huggingface.co/openai/whisper-base) converted to ONNX format for [onnx-asr](https://github.com/istupakov/onnx-asr).
|
12 |
|
13 |
+
Install onnx-asr
|
|
|
|
|
14 |
```shell
|
15 |
pip install onnx-asr[cpu,hub]
|
16 |
```
|
17 |
|
18 |
+
Load whisper-base model and recognize wav file
|
19 |
```py
|
20 |
import onnx_asr
|
21 |
model = onnx_asr.load_model("whisper-base")
|
22 |
print(model.recognize("test.wav"))
|
23 |
```
|
24 |
|
25 |
+
## Model export
|
26 |
|
27 |
Read onnxruntime [instruction](https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/python/tools/transformers/models/whisper/README.md) for convert Whisper to ONNX.
|
28 |
|
|
|
37 |
|
38 |
processor = WhisperTokenizer.from_pretrained("openai/whisper-base")
|
39 |
processor.save_pretrained("whisper-onnx")
|
40 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|