forked from sparklecatta-lang/sprite-video-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_ai_runtime.bat
More file actions
74 lines (63 loc) · 2.31 KB
/
Copy pathsetup_ai_runtime.bat
File metadata and controls
74 lines (63 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
setlocal
cd /d "%~dp0"
set "AI_ROOT=E:\sprite-video-lab-models"
if not exist "E:\" set "AI_ROOT=%~dp0work\models"
set "SPRITE_VIDEO_LAB_AI_MODEL_CACHE=%AI_ROOT%\huggingface"
set "HF_HOME=%SPRITE_VIDEO_LAB_AI_MODEL_CACHE%"
set "HUGGINGFACE_HUB_CACHE=%SPRITE_VIDEO_LAB_AI_MODEL_CACHE%\hub"
set "TRANSFORMERS_CACHE=%SPRITE_VIDEO_LAB_AI_MODEL_CACHE%\transformers"
set "HF_MODULES_CACHE=%SPRITE_VIDEO_LAB_AI_MODEL_CACHE%\modules"
set "HF_XET_CACHE=%SPRITE_VIDEO_LAB_AI_MODEL_CACHE%\xet"
set "HF_HUB_DISABLE_SYMLINKS_WARNING=1"
set "PIP_CACHE_DIR=%AI_ROOT%\pip-cache"
set "VENV_DIR=%AI_ROOT%\venv"
set "SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT=%AI_ROOT%\CorridorKey"
if not exist "%AI_ROOT%" mkdir "%AI_ROOT%"
set "PY_LAUNCHER="
set "BOOTSTRAP_PYTHON="
for /f "delims=" %%i in ('where py 2^>nul') do (
set "PY_LAUNCHER=%%i"
goto :bootstrap_ready
)
for /f "delims=" %%i in ('where python 2^>nul') do (
set "BOOTSTRAP_PYTHON=%%i"
goto :bootstrap_ready
)
echo Python not found.
exit /b 1
:bootstrap_ready
if not exist "%VENV_DIR%\Scripts\python.exe" (
echo Creating AI runtime at %VENV_DIR%
if not "%PY_LAUNCHER%"=="" (
"%PY_LAUNCHER%" -3 -m venv "%VENV_DIR%"
) else (
"%BOOTSTRAP_PYTHON%" -m venv "%VENV_DIR%"
)
)
set "PYTHON_EXE=%VENV_DIR%\Scripts\python.exe"
"%PYTHON_EXE%" -m pip install --upgrade pip
"%PYTHON_EXE%" -m pip install -r requirements.txt
"%PYTHON_EXE%" -m pip install -r requirements-ai.txt
"%PYTHON_EXE%" -m pip install --force-reinstall --no-deps --index-url https://download.pytorch.org/whl/cu128 torch torchvision
if not exist "%SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT%\CorridorKeyModule" (
for /f "delims=" %%i in ('where git 2^>nul') do (
echo Cloning CorridorKey to %SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT%
git clone --depth 1 https://github.com/nikopueringer/CorridorKey "%SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT%"
goto :corridorkey_ready
)
echo CorridorKey was not cloned because git was not found.
echo Install git or clone https://github.com/nikopueringer/CorridorKey to %SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT%
) else (
echo CorridorKey is available at %SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT%
)
:corridorkey_ready
echo.
echo AI runtime is ready:
echo %VENV_DIR%
echo Models will be cached in:
echo %SPRITE_VIDEO_LAB_AI_MODEL_CACHE%
echo CorridorKey root:
echo %SPRITE_VIDEO_LAB_CORRIDORKEY_ROOT%
echo.
pause