guoyu/Test/python/install_whisper.sh
2025-12-11 23:28:07 +08:00

33 lines
1.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Whisper 服务依赖安装脚本Linux 服务器)
# 使用清华大学镜像源加速
echo "======================================"
echo " 安装 Whisper 语音识别服务依赖"
echo "======================================"
# 1. 配置 pip 使用清华镜像
echo "[1/4] 配置 pip 镜像源..."
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 2. 升级 pip
echo "[2/4] 升级 pip..."
pip install --upgrade pip
# 3. 安装基础依赖
echo "[3/4] 安装 Flask 相关依赖..."
pip install flask==2.3.0 flask-cors==4.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
# 4. 安装 Whisper这个比较大需要耐心等待
echo "[4/4] 安装 openai-whisper可能需要几分钟..."
pip install openai-whisper -i https://pypi.tuna.tsinghua.edu.cn/simple
echo ""
echo "✅ 依赖安装完成!"
echo ""
echo "📝 后续步骤:"
echo "1. 首次运行会自动下载 Whisper 模型(约 140MB"
echo "2. 启动服务python whisper_server.py"
echo "3. 访问http://服务器IP:5001/health"
echo ""