Project02/AIGC/StartCommand.bat

18 lines
557 B
Batchfile
Raw Permalink Normal View History

2025-06-05 19:55:37 +08:00
@echo off
chcp 65001 > nul
2025-06-06 10:28:34 +08:00
set OLLAMA_MODEL=deepseek-r1:7b
2025-06-05 19:55:37 +08:00
rem 启动Ollama服务
2025-06-06 10:28:34 +08:00
start "Ollama DeepSeek" cmd /k ollama run %OLLAMA_MODEL%
2025-06-05 19:55:37 +08:00
rem 检测11434端口是否就绪
echo 等待Ollama服务启动...
:retry
powershell -command "$result = Test-NetConnection -ComputerName localhost -Port 11434 -WarningAction SilentlyContinue; if (-not $result.TcpTestSucceeded) { exit 1 }"
if %errorlevel% neq 0 (
timeout /t 5 >nul
goto retry
)
rem 启动Python脚本
call .\AIGC\Scripts\activate.bat
2025-06-06 10:28:34 +08:00
start "AIGC Python" python main.py --model %OLLAMA_MODEL%