diff --git a/whisper/.env.example b/whisper/.env.example index d7e4b06..7412857 100644 --- a/whisper/.env.example +++ b/whisper/.env.example @@ -12,3 +12,6 @@ WHISPER_CPU_THREADS=4 # -1 表示模型常驻显存;空闲自动卸载可改为 600 WHISPER_TTL=-1 + +# 模型下载地址:国内默认走 hf-mirror.com 镜像;能直连 Hugging Face 时改为空值(HF_ENDPOINT=) +HF_ENDPOINT=https://hf-mirror.com diff --git a/whisper/README.md b/whisper/README.md index df729cb..37be755 100644 --- a/whisper/README.md +++ b/whisper/README.md @@ -79,8 +79,9 @@ L4(24 GB 显存)可同时常驻两个模型;Speaches 支持在请求的 `m ## 常见问题 -- 首次启动下载模型慢或失败:在 `docker-compose.yml` 中取消 `HF_ENDPOINT=https://hf-mirror.com` - 注释后 `docker compose up -d`。 +- 首次启动下载模型慢或失败:默认已使用国内镜像 `https://hf-mirror.com`(可在 `.env` + 的 `HF_ENDPOINT` 覆盖);仍失败可改用代理,在 `docker-compose.yml` 的 + `environment` 里加 `HTTP_PROXY`/`HTTPS_PROXY` 后 `docker compose up -d`。 - 容器报 CUDA 错误:确认宿主机驱动 ≥ 535,并已安装 NVIDIA Container Toolkit。 - 转写结果没有说话人:Whisper 不做说话人分离,需要该功能请改用 `MOSS-Transcribe-Diarize`(见 `sentence_api/DEPLOYMENT.md`)。 diff --git a/whisper/docker-compose.yml b/whisper/docker-compose.yml index a47fa8e..5fe4b4a 100644 --- a/whisper/docker-compose.yml +++ b/whisper/docker-compose.yml @@ -12,8 +12,8 @@ services: WHISPER__CPU_THREADS: ${WHISPER_CPU_THREADS:-4} # -1 表示模型常驻显存;改为正数(秒)可让空闲模型自动卸载 WHISPER__TTL: ${WHISPER_TTL:--1} - # 服务器无法直连 Hugging Face 时取消注释(国内镜像): - # HF_ENDPOINT: https://hf-mirror.com + # 模型下载地址:国内默认走 hf-mirror.com 镜像;能直连 Hugging Face 时在 .env 里设 HF_ENDPOINT=(留空) + HF_ENDPOINT: ${HF_ENDPOINT:-https://hf-mirror.com} volumes: - hf-hub-cache:/home/ubuntu/.cache/huggingface/hub deploy: