Downloads · 30 days
0
kotoba-tech/kotoba-whisper-v2.0-ggml
kotoba-whisper-v2.0-ggml is a automatic speech recognition model from kotoba-tech. Use it when you need speech turned into text. The card lists the license as apache-2.0.
This repository contains the model weights for kotoba-tech/kotoba-whisper-v2.0 converted to GGML format. GGML is the weight format expected by C/C++ packages such as Whisper.cpp, for which we provide an example below.
Downloads · 30 days
0
Access
Public
Updated Sep 29, 2024
Repo size
2.1 GB
Likes
10
Public
Click a slice to open those files.
.bin2.1 GB · 100%
From the Hugging Face model README
This repository contains the model weights for kotoba-tech/kotoba-whisper-v2.0 converted to GGML format. GGML is the weight format expected by C/C++ packages such as Whisper.cpp, for which we provide an example below.
Kotoba-Whisper can be run with the Whisper.cpp package with the original sequential long-form transcription algorithm.
Steps for getting started:
git clone https://github.com/ggerganov/whisper.cpp.git
cd whisper.cpp
kotoba-tech/kotoba-whisper-v2.0:wget https://huggingface.co/kotoba-tech/kotoba-whisper-v2.0-ggml/resolve/main/ggml-kotoba-whisper-v2.0.bin -P ./models
wget https://huggingface.co/kotoba-tech/kotoba-whisper-v1.0-ggml/resolve/main/sample_ja_speech.wav
make -j && ./main -m models/ggml-kotoba-whisper-v2.0.bin -l ja -f sample_ja_speech.wav --output-file transcription --output-json
Note that it runs only with 16-bit WAV files, so make sure to convert your input before running the tool. For example, you can use ffmpeg like this:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav
We measure the inference speed of different kotoba-whisper-v2.0 implementations with four different Japanese speech audio on MacBook Pro with the following spec:
| audio file | audio duration (min) | whisper.cpp (sec) | faster-whisper (sec) | hf pipeline (sec) |
|---|---|---|---|---|
| audio 1 | 50.3 | 581 | 2601 | 807 |
| audio 2 | 5.6 | 41 | 73 | 61 |
| audio 3 | 4.9 | 30 | 141 | 54 |
| audio 4 | 5.6 | 35 | 126 | 69 |
Scripts to re-run the experiment can be found bellow:
Also, currently whisper.cpp and faster-whisper support the sequential long-form decoding, and only Huggingface pipeline supports the chunked long-form decoding, which we empirically found better than the sequnential long-form decoding.
To use the quantized model, download the quantized GGML weights:
wget https://huggingface.co/kotoba-tech/kotoba-whisper-v2.0-ggml/resolve/main/ggml-kotoba-whisper-v2.0-q5_0.bin -P ./models
Run inference on the sample audio:
make -j && ./main -m models/ggml-kotoba-whisper-v2.0-q5_0.bin -l ja -f sample_ja_speech.wav --output-file transcription.quantized --output-json
Note that the benchmark results are almost identical to the raw non-quantized model weight.
The original model was converted with the following command:
# clone OpenAI whisper and whisper.cpp
git clone https://github.com/openai/whisper
git clone https://github.com/ggerganov/whisper.cpp
# get the models
cd whisper.cpp/models
git clone https://huggingface.co/kotoba-tech/kotoba-whisper-v2.0
# convert to ggml
python3 ./convert-h5-to-ggml.py ./kotoba-whisper-v2.0/ ../../whisper .
mv ggml-model.bin ggml-kotoba-whisper-v2.0
# quantize ggml model
cd ../
make quantize
./quantize models/ggml-kotoba-whisper-v2.0.bin models/ggml-kotoba-whisper-v2.0-q5_0.bin q5_0
For more information about the kotoba-whisper-v2.0, refer to the original model card.