-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_and_run.bat
56 lines (44 loc) · 1.26 KB
/
install_and_run.bat
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
@ECHO OFF
cmd
:: check if Python is installed
ECHO Checking if python is installed
python --version
if errorlevel 1 goto errorNoPython
ECHO Python is installed...
:: check version
ECHO Checking Python version...
for /f "tokens=*" %%a in ('python versioncheck.py') do set _PythonVersionOK=%%a
IF "%_PythonVersionOK%"=="True" (
ECHO Python version >= 3.6
) ELSE (
ECHO Python version < 3.6
ECHO Please install Python >= 3.6
start https://www.python.org/downloads/
PAUSE
EXIT
)
:: virutal environment
ECHO Creating virtual environment...
python -m venv lmpowered-venv
ECHO Virutal environment created...
ECHO Activating virtual environment...
lmpowered-venv\Scripts\activate.bat
ECHO Virutal environment activated...
:: install dependencies
ECHO Installing Dependencies...
@pip install -r requirements.txt > nul
ECHO Dependencies installed...
:: instal pytorch
ECHO Installing PyTorch...
@pip3 install torch===1.3.1 torchvision===0.4.2 -f https://download.pytorch.org/whl/torch_stable.html > nul
ECHO PyTorch installed...
:: start server
ECHO Starting API-Server...
python webservice.py
goto :eof
errorNoPython:
ECHO.
ECHO Error^: Python not installed
ECHO Install Python and add it to the PATH environment variable
start https://www.python.org/downloads/
PAUSE