Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,32 +303,23 @@ pip3 install -e ./

SenseVoice can be built and run using Docker to simplify setup, ensure reproducibility, and support both CPU and GPU inference.

### Official image

The official `linux/amd64` runtime image is published to GitHub Container Registry. Model weights are not embedded in the image; they are downloaded into the mounted `/models` cache on first start.

```bash
docker pull ghcr.io/qwenaudio/sensevoice:latest
docker run --rm --gpus all \
-p 50000:50000 \
-v sensevoice-models:/models \
ghcr.io/qwenaudio/sensevoice:latest
```

Open `http://127.0.0.1:50000/docs` after the container becomes healthy. Release tags and immutable `sha-<commit>` tags are available in the [container package](https://github.com/QwenAudio/SenseVoice/pkgs/container/sensevoice).

### Build with Docker
```bash
docker build -t sensevoice .
```

> The build workflow also publishes `ghcr.io/qwenaudio/sensevoice`, but the
> package is currently private and anonymous pulls return HTTP 401. Use the
> local build above until the [container package](https://github.com/QwenAudio/SenseVoice/pkgs/container/sensevoice)
> is marked Public.

### Run (GPU – default)
```bash
docker run --gpus all -p 50000:50000 sensevoice
```
### Run (CPU-only)
```bash
docker run --rm -e SENSEVOICE_DEVICE=cpu -p 50000:50000 -v sensevoice-models:/models ghcr.io/qwenaudio/sensevoice:latest
docker run --rm -e SENSEVOICE_DEVICE=cpu -p 50000:50000 -v sensevoice-models:/models sensevoice
```
### Docker Compose
Docker Compose provides an easier way to run SenseVoice with persistent model caching, networking etc.
Expand Down
26 changes: 18 additions & 8 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,19 +274,29 @@ export SENSEVOICE_DEVICE=cuda:0
fastapi run --port 50000
```

### Docker 官方镜像
### 使用 Docker 构建

官方 `linux/amd64` 运行时镜像发布在 GitHub Container Registry。镜像不内置模型权重;首次启动会把权重下载到挂载的 `/models` 缓存。
```bash
docker build -t sensevoice .
```

> 构建工作流也会发布 `ghcr.io/qwenaudio/sensevoice`,但该容器包当前为
> private,匿名拉取会返回 HTTP 401。在[容器包页面](https://github.com/QwenAudio/SenseVoice/pkgs/container/sensevoice)
> 显示 Public 之前,请使用上面的本地构建。

### 运行(GPU,默认)

```bash
docker run --rm --gpus all -p 50000:50000 -v sensevoice-models:/models sensevoice
```

### 运行(仅 CPU)

```bash
docker pull ghcr.io/qwenaudio/sensevoice:latest
docker run --rm --gpus all \
-p 50000:50000 \
-v sensevoice-models:/models \
ghcr.io/qwenaudio/sensevoice:latest
docker run --rm -e SENSEVOICE_DEVICE=cpu -p 50000:50000 -v sensevoice-models:/models sensevoice
```

容器健康后访问 `http://127.0.0.1:50000/docs`。版本 tag 和不可变的 `sha-<commit>` tag 见 [容器包页面](https://github.com/QwenAudio/SenseVoice/pkgs/container/sensevoice)。CPU 模式增加 `-e SENSEVOICE_DEVICE=cpu` 并移除 `--gpus all`。
容器健康后访问 `http://127.0.0.1:50000/docs`。

## 微调

Expand Down
13 changes: 11 additions & 2 deletions tests/test_container_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,25 @@ def test_container_workflow_builds_prs_and_only_pushes_trusted_refs(self):
workflow,
)

def test_readme_uses_public_ghcr_image_and_real_service_port(self):
def test_readme_uses_real_service_port_and_no_retired_registry(self):
readme = (ROOT / "README.md").read_text(encoding="utf-8")

self.assertIn("ghcr.io/qwenaudio/sensevoice", readme.lower())
self.assertIn("-p 50000:50000", readme)
self.assertNotIn(
"registry.cn-hangzhou.aliyuncs.com/funasr/sensevoice",
readme,
)

def test_readmes_do_not_offer_private_ghcr_image_as_anonymous_pull(self):
for name in ("README.md", "README_zh.md"):
readme = (ROOT / name).read_text(encoding="utf-8").lower()

self.assertNotIn(
"docker pull ghcr.io/qwenaudio/sensevoice:latest",
readme,
)
self.assertIn("docker build -t sensevoice .", readme)


if __name__ == "__main__":
unittest.main()
Loading