SuperAI_Forecast / run.bat
Thang6822
Update branding to SuperAI Forecast
9734b71
Raw
History Blame
2.65 kB
@echo off
TITLE SuperAI Forecast Terminal
COLOR 0B
chcp 65001 >nul 2>&1
echo.
echo SUPERAI FORECAST TERMINAL - STARTUP
echo Powered by Kronos + TimesFM + Chronos
echo ====================================================
echo.
:: Set explicit venv python path (avoids conflict with global Python 3.13)
set "PYEXE=%~dp0venv\Scripts\python.exe"
:: [1/4] Check virtual environment
echo [1/4] Checking virtual environment...
if not exist "%PYEXE%" (
echo [ERROR] venv not found. Run: python -m venv venv
pause
exit /b 1
)
echo [OK] venv found.
:: [2/4] Check AI model dependencies
echo [2/4] Checking AI model dependencies...
"%PYEXE%" -c "import timesfm; timesfm.TimesFM_2p5_200M_torch" >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo [INFO] TimesFM not found. Installing...
if exist "%~dp0libs\timesfm\pyproject.toml" (
echo [INFO] Installing from libs\timesfm...
"%PYEXE%" -m pip install -e "%~dp0libs\timesfm[torch]" -q
) else (
echo [INFO] Cloning TimesFM from GitHub...
git clone --depth=1 https://github.com/google-research/timesfm.git "%~dp0libs\timesfm"
if %ERRORLEVEL% neq 0 (
echo [ERROR] git clone failed. Check internet connection.
pause
exit /b 1
)
"%PYEXE%" -m pip install -e "%~dp0libs\timesfm[torch]" -q
)
if %ERRORLEVEL% neq 0 (
echo [ERROR] TimesFM install failed.
pause
exit /b 1
)
echo [OK] TimesFM installed.
) else (
echo [OK] TimesFM is ready.
)
if exist "%~dp0libs\chronos-forecasting\src\chronos\__init__.py" (
echo [OK] Chronos repository is ready.
) else (
echo [INFO] Chronos repository not found. Cloning...
git clone --depth=1 https://github.com/amazon-science/chronos-forecasting "%~dp0libs\chronos-forecasting"
if %ERRORLEVEL% neq 0 (
echo [WARN] Chronos clone failed. The app will continue, but Chronos may be unavailable.
) else (
echo [OK] Chronos repository is ready.
)
)
:: [3/4] Apply huggingface_hub compatibility patch
echo [3/4] Applying compatibility patch...
if exist "%~dp0scripts\patch_timesfm.py" (
"%PYEXE%" "%~dp0scripts\patch_timesfm.py" >nul 2>&1
echo [OK] Patch applied.
) else (
echo [WARN] Patch script not found, skipping.
)
:: [4/4] Launch server
echo [4/4] Launching server...
echo.
echo [INFO] Browser opens automatically when the server is ready.
echo [INFO] Check launcher log for the exact local address.
echo [INFO] Press CTRL+C to stop.
echo.
"%PYEXE%" -m backend.launcher
if %ERRORLEVEL% neq 0 (
echo.
echo [ERROR] Server exited with error. See log above.
pause
)