ROS 2 inference for whisper.cpp.
- Install
pyaudio
, see install instructions. - Build this repository, do
mkdir -p whisper_ws/src && cd whisper_ws/src && \
git clone https://github.com/ros-ai/ros2_whisper.git && cd .. && \
colcon build --symlink-install --cmake-args -DWHISPER_CUBLAS=On
Run the inference action server (this will download models to $HOME/.cache/whisper.cpp
):
ros2 launch whisper_bringup bringup.launch.py n_thread:=4
Run a client node (activated on space bar press):
ros2 run whisper_demos whisper_on_key
Action server under topic inference
of type Inference.action.
- Encoder inference time: ggerganov/whisper.cpp#10 (comment)
- Compile with GPU support (might differ between platforms): https://github.com/ggerganov/whisper.cpp#nvidia-gpu-support-via-cublas WHISPER_CUBLAS=On