This repository provides a Docker image for SenseVoice, enabling you to deploy the SenseVoice ASR service within a Docker container.
To run this Docker container, you’ll need a machine with NVIDIA GPU support and the NVIDIA Container Toolkit installed. For detailed installation steps, please refer to the NVIDIA Container Toolkit guide.
$ docker build -t sensevoice .$ docker run -d --name sensevoice_server -p 8080:8080 \
--runtime=nvidia \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-e NVIDIA_VISIBLE_DEVICES=all \
sensevoice- Create a
docker-compose.ymlfile:
services:
sensevoice_server:
image: sensevoice
container_name: sensevoice_server
ports:
- "8080:8080"
restart: always
runtime: nvidia
environment:
NVIDIA_DRIVER_CAPABILITIES: all
NVIDIA_VISIBLE_DEVICES: all- Start the container:
$ docker compose up -dTo test the API, use curl:
# download url audio file example
curl -X 'POST' \
'http://127.0.0.1:8080/api/v1/asr' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'url=https://iic-sensevoice.ms.show/file=/tmp/gradio/1f7cfa14376cc0bb5f6071a7b0d7bea610842119/zh.mp3'
# upload audio file example
curl -X 'POST' \
'http://127.0.0.1:8080/api/v1/asr' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@vad_example.wav' \
-F 'language=auto'