-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
61 lines (52 loc) · 1.14 KB
/
Copy pathsetup.bat
File metadata and controls
61 lines (52 loc) · 1.14 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
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "SILENT=0"
set "WITH_VLM=0"
for %%A in (%*) do (
if /I "%%A"=="--silent" set "SILENT=1"
if /I "%%A"=="--with-vlm" set "WITH_VLM=1"
)
if not exist ".venv_gpu\Scripts\python.exe" (
py -3.11 -m venv .venv_gpu
if errorlevel 1 (
echo FAIL: create .venv_gpu
if "%SILENT%"=="0" pause
exit /b 2
)
)
call ".venv_gpu\Scripts\activate.bat"
if errorlevel 1 (
echo FAIL: activate .venv_gpu
if "%SILENT%"=="0" pause
exit /b 3
)
python -m pip install --upgrade pip
if errorlevel 1 (
echo FAIL: pip upgrade
if "%SILENT%"=="0" pause
exit /b 4
)
python -m pip install -r requirements.txt
if errorlevel 1 (
echo FAIL: install requirements.txt
if "%SILENT%"=="0" pause
exit /b 5
)
if "%WITH_VLM%"=="1" (
if exist "requirements_vlm.txt" (
python -m pip install -r requirements_vlm.txt
if errorlevel 1 (
echo FAIL: install requirements_vlm.txt
if "%SILENT%"=="0" pause
exit /b 6
)
)
)
call check_requirements.bat --silent
if errorlevel 1 (
echo FAIL: check_requirements
if "%SILENT%"=="0" pause
exit /b 7
)
echo OK: setup complete
exit /b 0