updated template
Browse files
README.md
CHANGED
|
@@ -100,10 +100,10 @@ Alternatively, you can download the models for local usage. The Tiny, Base, and
|
|
| 100 |
|
| 101 |
```bash
|
| 102 |
# Download the sample file
|
| 103 |
-
|
| 104 |
|
| 105 |
# Install necessary libraries.
|
| 106 |
-
|
| 107 |
```
|
| 108 |
|
| 109 |
After this is done, you should be able to run this in Python:
|
|
@@ -183,10 +183,12 @@ asr("king.mp3", chunk_length_s=30, return_timestamps=True, generate_kwargs={'tas
|
|
| 183 |
</details>
|
| 184 |
|
| 185 |
Some other cool features to look into:
|
|
|
|
| 186 |
```python
|
| 187 |
# Transcribe to Nynorsk
|
| 188 |
asr("king.mp3", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'nn'})
|
| 189 |
```
|
|
|
|
| 190 |
<details>
|
| 191 |
<summary>Expected output</summary>
|
| 192 |
|
|
@@ -235,7 +237,24 @@ asr("king.mp3", chunk_length_s=30, return_timestamps="word", generate_kwargs={'t
|
|
| 235 |
### Whisper CPP
|
| 236 |
Whisper CPP is a C++ implementation of the Whisper model, offering the same functionalities with the added benefits of C++ efficiency and performance optimizations. This allows embedding any Whisper model into a binary file, facilitating the development of real applications. However, it requires some familiarity with compiling C++ programs. Their [homepage](https://github.com/ggerganov/whisper.cpp) provides examples of how to build applications, including real-time transcription.
|
| 237 |
|
| 238 |
-
We have converted this model to the ggml-format model used by Whisper CPP binaries. The file can be downloaded [here](blob/main/ggml-model.bin).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
|
| 240 |
### API
|
| 241 |
Instructions for accessing the models via a simple API are included in the demos under Spaces. Note that these demos are temporary and will only be available for a few weeks.
|
|
|
|
| 100 |
|
| 101 |
```bash
|
| 102 |
# Download the sample file
|
| 103 |
+
$ wget -N https://github.com/NbAiLab/nb-whisper/raw/main/audio/king.mp3
|
| 104 |
|
| 105 |
# Install necessary libraries.
|
| 106 |
+
$ pip install transformers>=4.35.2
|
| 107 |
```
|
| 108 |
|
| 109 |
After this is done, you should be able to run this in Python:
|
|
|
|
| 183 |
</details>
|
| 184 |
|
| 185 |
Some other cool features to look into:
|
| 186 |
+
|
| 187 |
```python
|
| 188 |
# Transcribe to Nynorsk
|
| 189 |
asr("king.mp3", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'nn'})
|
| 190 |
```
|
| 191 |
+
|
| 192 |
<details>
|
| 193 |
<summary>Expected output</summary>
|
| 194 |
|
|
|
|
| 237 |
### Whisper CPP
|
| 238 |
Whisper CPP is a C++ implementation of the Whisper model, offering the same functionalities with the added benefits of C++ efficiency and performance optimizations. This allows embedding any Whisper model into a binary file, facilitating the development of real applications. However, it requires some familiarity with compiling C++ programs. Their [homepage](https://github.com/ggerganov/whisper.cpp) provides examples of how to build applications, including real-time transcription.
|
| 239 |
|
| 240 |
+
We have converted this model to the ggml-format model used by Whisper CPP binaries. The file can be downloaded [here](blob/main/ggml-model.bin), and a `q5_0` quantized version is also available [here](blob/main/ggml-model-q5_0.bin).
|
| 241 |
+
|
| 242 |
+
```bash
|
| 243 |
+
# We can download and compile whisper.cpp
|
| 244 |
+
$ git clone --depth 1 https://github.com/ggerganov/whisper.cpp --branch v1.5.1
|
| 245 |
+
$ cd whisper.cpp/
|
| 246 |
+
$ make
|
| 247 |
+
|
| 248 |
+
# We also need to convert the audio to WAV as that is the only format supported by whisper.cpp
|
| 249 |
+
$ wget -N https://github.com/NbAiLab/nb-whisper/raw/main/audio/king.mp3
|
| 250 |
+
$ ffmpeg -i king.mp3 -ar 16000 -ac 1 -c:a pcm_s16le king.wav
|
| 251 |
+
|
| 252 |
+
# And run it with the f16 default model
|
| 253 |
+
$ ./main -m /path/to/ggml-model.bin king.wav
|
| 254 |
+
|
| 255 |
+
# Or the quantized version
|
| 256 |
+
$ ./main -m /path/to/ggml-model-q5_0.bin king.wav
|
| 257 |
+
```
|
| 258 |
|
| 259 |
### API
|
| 260 |
Instructions for accessing the models via a simple API are included in the demos under Spaces. Note that these demos are temporary and will only be available for a few weeks.
|