For more information see the OpenAI whisper paper.
Supported platforms:
- Linux
- Mac OS (Intel)
- Android OS
- Apple iOS
TensorFlow Lite C++ minimal example to run inference on whisper.tflite(~40 MB hybrid model weights are in int8 and activations are in float32)
This example shows how you can build a simple TensorFlow Lite application.
It requires 'git lfs install' as our whisper.tflite model uses Git Large File Storage (LFS).
you can follow git lfs installation guide
git clone https://github.com/usefulsensors/openai-whisper.git
cd openai-whisperIt requires CMake 3.16 or higher. On Ubuntu, you can simply run the following command.
sudo apt-get install cmakeOr you can follow the official cmake installation guide
git clone https://github.com/tensorflow/tensorflow.git tensorflow_srccp tflite_minimal/minimal.cc tensorflow_src/tensorflow/lite/examples/minimal/
cp tflite_minimal/*.h tensorflow_src/tensorflow/lite/examples/minimal/mkdir minimal_build
cd minimal_build
cmake ../tensorflow_src/tensorflow/lite/examples/minimalIn the minimal_build directory,
# build the minimal example
cmake --build . -jcp ../tflite_minimal/filters_vocab_gen.bin ././minimal ../models/whisper.tflite
# transcribe an audio file
./minimal ../models/whisper.tflite ../samples/jfk.wav
./minimal ../models/whisper.tflite ../samples/test.wav
./minimal ../models/whisper.tflite ../samples/test_1.wavNote: Use the arecord application to record test audio on a Linux computer.
arecord -r 16000 -c 1 -d 30 -f S16_LE test.wavFeel free to download the openai/whisper-tiny tflite-based Android Whisper ASR APP from Google App Store.
Feel free to download the openai/whisper-tiny tflite-based Apple Whisper ASR APP from Apple App Store.