Install Whisper.cpp on Ubuntu 24

Mindwatering Incorporated

Author: Tripp W Black

Created: 11/17 at 02:00 AM

 

Category:
Linux
Other

Task:


Install whisper.cpp on Ubuntu 24 for command-line audio translation.


Steps:


1. Prep:
a. Login:
$ ssh myadminid@myserver.mindwatering.net
<enter pwd if not private key>

b. Install prerequisites:
$ sudo apt-get update && sudo apt-get install git cmake build-essentials
<approve and wait>


2. Install whisper.cpp:
a. Choose installation location:
$ cd /opt/

b. Clone into new folder:
$ git clone https://github.com/ggml-org/whisper.cpp.git
$ mv whisper.cpp/ whispercpp/
$ cd whisper.cpp
$ sudo su -

c. Install English language model:
# sh .models/download-ggml-model.sh medium.en
<wait>

d. Build the project:
# cmake -B build
# cmake --build build -j --config Release

e. Change owner to root with others able to read/execute the cli.
# chown -R root:<root or a group> ./
.. <perform changes depending on desires for others to run>
# exit


ln -s /opt/whispercpp/build/bin/whisper-cli /usr/bin/whisper-cli


3. Try out a audio file:
Notes:
- Convert the audio to 16-bit before processing.
- The audio will be printed to the terminal screen. To save as a file use > filename.txt.
a. Example conversion:
$ ffmpeg -i /home/sysadmin/videofilesource.mp4 -ar 16000 -ac 1 -c:a pcm_s16le /home/sysadmin/myfiletoconvert.wav

b. Example transcription:
e.g.
$ cd /opt/whispercpp/
$ ./build/bin/whisper-cli -f /home/myadminid/myfiletoconvert.wav > /home/myadminid/myfiletoconvert.txt

e.g.
$ ./build/bin/whisper-cli/whisper-cli -m /opt/whispercpp/models/ggml-large-v3.bin -f /home/myadminid/myfiletoconvert.wav > /home/myadminid/myfiletoconvert.txt

---

Other models
Notes:
- The .en indicates English only
- Tiny uses about 75 MB of disk and 273 MB of memory, while medium uses about 1.5 GB of disk and 2.1 GB of memory, while large uses about 2.9 GB of disk and 3.9 GB of memory

tiny.en
tiny
base.en
base
small.en
small
medium.en
medium
large-v1
large-v2
large-v3
large-v3-turbo


previous page

×