guoyu/Test/python/一键安装并启动.bat
2025-12-11 23:28:07 +08:00

65 lines
1.3 KiB
Batchfile
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.

@echo off
chcp 65001 >nul
title Whisper 一键安装并启动
echo ========================================
echo Whisper 服务一键安装并启动
echo ========================================
echo.
cd /d "%~dp0"
echo [步骤 1/4] 安装 PyTorch (CPU版)...
echo (这可能需要 3-5 分钟,请耐心等待)
echo.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
if %errorlevel% neq 0 (
echo.
echo ❌ PyTorch 安装失败!
pause
exit /b 1
)
echo ✅ PyTorch 安装完成
echo.
echo [步骤 2/4] 安装 Whisper...
pip install -U openai-whisper
if %errorlevel% neq 0 (
echo.
echo ❌ Whisper 安装失败!
pause
exit /b 1
)
echo ✅ Whisper 安装完成
echo.
echo [步骤 3/4] 安装 Flask...
pip install flask flask-cors
if %errorlevel% neq 0 (
echo.
echo ❌ Flask 安装失败!
pause
exit /b 1
)
echo ✅ Flask 安装完成
echo.
echo ========================================
echo ✅ 所有依赖安装完成!
echo ========================================
echo.
echo [步骤 4/4] 启动 Whisper 服务...
echo.
echo 服务地址: http://localhost:5001
echo.
echo ⚠️ 首次运行会下载模型约140MB请耐心等待
echo ⚠️ 按 Ctrl+C 可停止服务
echo.
echo ========================================
echo.
python whisper_server.py
pause