From 04af9d6b60f0fc8fc95e3d956a9384faa0a727e2 Mon Sep 17 00:00:00 2001 From: lizhongxiang Date: Wed, 26 Feb 2025 14:31:18 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E9=83=A8=E7=BD=B2=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- entrypoint-api.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 entrypoint-api.sh diff --git a/Dockerfile b/Dockerfile index 706fdf470..990df4cfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,4 +61,4 @@ ENV PATH="/opt/venv/bin:$PATH" COPY . . # 启动应用 -CMD ["python", "app.py"] \ No newline at end of file +CMD ["./entrypoint-api.sh"] \ No newline at end of file diff --git a/entrypoint-api.sh b/entrypoint-api.sh new file mode 100755 index 000000000..043a27569 --- /dev/null +++ b/entrypoint-api.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# 检查 asr-models/SenseVoiceSmall 目录是否存在 +if [ ! -d "asr-models/SenseVoiceSmall" ]; then + # 如果目录不存在,执行下载脚本 + python modelscope_model_download.py +fi + +# 执行 app.py +python app.py +