-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
130 lines (117 loc) · 3.46 KB
/
install.bat
File metadata and controls
130 lines (117 loc) · 3.46 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@echo off
REM Windows installation script for Takenoko
REM This script installs all dependencies using uv package manager
echo ========================================
echo Takenoko Installation Script
echo ========================================
echo.
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python is not installed or not in PATH
echo Please install Python 3.10 or higher from https://python.org
pause
exit /b 1
)
echo Python found. Checking version...
python --version
REM Check if uv is installed
uv --version >nul 2>&1
if errorlevel 1 (
echo.
echo uv package manager not found. Installing uv...
echo.
powershell -Command "irm https://astral.sh/uv/install.ps1 | iex"
if errorlevel 1 (
echo ERROR: Failed to install uv
echo Please install uv manually from https://docs.astral.sh/uv/getting-started/installation/
pause
exit /b 1
)
echo uv installed successfully!
echo.
echo Please restart your terminal and run this script again.
pause
exit /b 0
)
echo uv found. Version:
uv --version
echo.
REM Check CUDA availability
echo Checking CUDA availability...
nvidia-smi --query-gpu=name,memory.total,memory.free,memory.used,driver_version --format=csv >nul 2>&1
if errorlevel 1 (
echo WARNING: NVIDIA GPU not detected or CUDA not installed
echo Will install CPU-only version
set CUDA_EXTRA=""
) else (
echo NVIDIA GPU detected. Installing CUDA 12.8 version...
set CUDA_EXTRA="[cu128]"
echo.
echo GPU summary ^(model, memory, driver^):
nvidia-smi --query-gpu=name,memory.total,memory.free,memory.used,driver_version --format=csv
)
echo.
echo Setting up virtual environment...
if exist ".venv" (
echo Virtual environment already exists at .venv
) else (
echo Ensuring Python 3.11 is available...
uv python install 3.11
echo Creating virtual environment with Python 3.11...
uv venv --python 3.11
if errorlevel 1 (
echo.
echo ERROR: Failed to create virtual environment!
echo Please check the error messages above and try again.
pause
exit /b 1
)
echo Virtual environment created successfully!
)
echo.
echo Activating virtual environment...
call .venv\Scripts\activate.bat
if errorlevel 1 (
echo.
echo ERROR: Failed to activate virtual environment!
echo Please check the error messages above and try again.
pause
exit /b 1
)
echo Virtual environment activated successfully!
echo.
echo Installing Takenoko dependencies...
echo.
REM Install the project in editable mode with appropriate CUDA extras
uv pip install -e .%CUDA_EXTRA%
if errorlevel 1 (
echo.
echo ERROR: Installation failed!
echo Please check the error messages above and try again.
pause
exit /b 1
)
echo.
echo Checking installed torch version...
python -c "import torch; print('Torch version:', torch.__version__)" || echo Torch is not installed or import failed.
echo.
echo ========================================
echo Installation completed successfully!
echo ========================================
echo.
echo Virtual environment is now ready at: .venv
echo.
echo Running installation test...
python tools/verify_installation.py
echo.
echo You can now run the trainer using:
echo run_trainer.bat
echo.
echo Or manually with:
echo python src/takenoko.py configs/your_config.toml
echo.
echo To activate the virtual environment manually:
echo .venv\Scripts\activate.bat
echo.
pause