
Whisper.cpp is a high-performance and lightweight inference of the OpenAI Whisper automatic speech recognition (ASR) model. It offers plain C/C++ implementations without dependency packages and performs speech recognition with support for both CPU and GPU-based systems.
This article explains how to build a Whisper.cpp container image and publish it to a Vultr Container Registry.
Before you begin:
Deploy an instance using Vultr's GPU Marketplace App
Access the server using SSH.
Start the Docker service.
Add the non-root user to the Docker group. For example, linuxuser.
Switch to the user:
Create a new directory to store your Whisper C++ project files.
Switch to the directory.
Clone the Whisper.cpp project repository using Git.
List all directory files and verify that a new whisper.cpp directory is available.
Output:
Switch to the project directory.
List all hidden files and verify that a .devops directory is available.
Output:
The .devops directory includes the following Dockerfile resources:
main.Dockerfile: Contains the build context for CPU systems.main-cuda.Dockerfile: Contains the build context for GPU systems.Use the above resources in the next sections to build a CPU or GPU system container image.
Follow the steps below to build a Whisper.cpp container image using the main.Dockerfile that contains all necessary dependencies for CPU-based systems.
Copy the main.Dockerfile from the .devops directory to the main whisper.cpp project directory.
Build a new container image using main.Dockerfile with all files in the project directory. Replace whisper-image with your desired image name.
Wait for the build process to complete. When successful, your output should look like the one below.
View all Docker images on the server and verify that the new whisper-image is available.
Output:
The Whisper.cpp main-cuda.Dockerfile resource contains the build context for GPU systems compatible with the latest NVIDIA CUDA drivers. Follow the steps below to build a Whisper.cpp container image compatible with NVIDIA GPU systems.
Copy main-cuda.Dockerfile to the main project directory.
Build a new container image whisper-gpu-image using the main-cuda.Dockerfile with all files in the working project directory.
View all Docker images on the server and verify that the new Whisper.cpp GPU image is available.
Output:
To run the whisper.cpp GPU container image, verify that your target host includes the minimum or higher CUDA version referenced by the ARG CUDA_VERSION= directive within the main-cuda.Dockerfile. Run the following command to verify the target CUDA version.
Output:
Open the Vultr Console.
Click Products and select Container Registry on the main navigation menu.
Click your target Vultr Container Registry to open the management panel and view the registry access credentials.
Copy the Registry URL value, Username, and API Key to use when accessing the registry.
Switch to your server terminal session and log in to your Vultr Container Registry. Replace exampleregistry, exampleuser, registry-password with your actual registry details.
Tag the whisper.cpp container image with your desired Vultr Container Registry tag. For example, sjc.vultrcr.com/exampleregistry/whisper-gpu-image.
View all Docker images on the server and verify that the new tagged image is available.
Output:
Push the tagged image to your Vultr Container Registry.
When successful, your output should be similar to the one below:
Open your Vultr Container Registry management panel and click Repositories on the top navigation bar to verify that the new repository is available.
0 Comments
Be the first to comment and share your perspective with the community.