71 lines
1.9 KiB
Plaintext
71 lines
1.9 KiB
Plaintext
|
|
# ============================================
|
|||
|
|
# Whisper 服务器端安装命令清单 (Windows 版本)
|
|||
|
|
# ============================================
|
|||
|
|
|
|||
|
|
# 一、配置 pip 使用清华镜像(加速下载)
|
|||
|
|
# ============================================
|
|||
|
|
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 二、安装 Python 依赖包
|
|||
|
|
# ============================================
|
|||
|
|
pip install flask==2.3.0 flask-cors==4.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 三、验证安装(Windows 版本)
|
|||
|
|
# ============================================
|
|||
|
|
# 方式1:使用 PowerShell 管道
|
|||
|
|
pip list | Select-String -Pattern "flask|whisper|cors"
|
|||
|
|
|
|||
|
|
# 方式2:使用 findstr(CMD)
|
|||
|
|
pip list | findstr /i "flask whisper cors"
|
|||
|
|
|
|||
|
|
# 方式3:直接查看全部(简单)
|
|||
|
|
pip list
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 四、启动 Whisper 服务
|
|||
|
|
# ============================================
|
|||
|
|
|
|||
|
|
# 方式1:前台运行(测试用)
|
|||
|
|
python whisper_server.py
|
|||
|
|
|
|||
|
|
# 方式2:后台运行(使用 start 命令)
|
|||
|
|
start /b python whisper_server.py > whisper.log 2>&1
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 五、验证服务是否启动成功
|
|||
|
|
# ============================================
|
|||
|
|
# 使用 PowerShell 测试
|
|||
|
|
curl http://localhost:5001/health
|
|||
|
|
|
|||
|
|
# 或使用浏览器访问
|
|||
|
|
# http://localhost:5001/health
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 六、开放 Windows 防火墙端口
|
|||
|
|
# ============================================
|
|||
|
|
netsh advfirewall firewall add rule name="Whisper Service" dir=in action=allow protocol=TCP localport=5001
|
|||
|
|
|
|||
|
|
# 查看防火墙规则
|
|||
|
|
netsh advfirewall firewall show rule name="Whisper Service"
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 七、查看服务运行状态
|
|||
|
|
# ============================================
|
|||
|
|
# 查看 Python 进程
|
|||
|
|
tasklist | findstr python
|
|||
|
|
|
|||
|
|
# 查看端口占用
|
|||
|
|
netstat -ano | findstr 5001
|
|||
|
|
|
|||
|
|
|
|||
|
|
# 八、停止服务
|
|||
|
|
# ============================================
|
|||
|
|
# 方式1:找到进程 ID 后停止
|
|||
|
|
tasklist | findstr python
|
|||
|
|
taskkill /PID 进程ID /F
|
|||
|
|
|
|||
|
|
# 方式2:直接停止所有 python 进程(谨慎使用)
|
|||
|
|
taskkill /IM python.exe /F
|