add build_run script

This commit is contained in:
xiaoshuisheng 2023-12-11 11:00:58 +08:00
parent 97015b6b38
commit 4c124bc8e5
2 changed files with 47 additions and 0 deletions

22
build.bat Normal file
View File

@ -0,0 +1,22 @@
@echo off
setlocal
set VENV_DIR=venv
set REQUIREMENTS=requirements.txt
echo Setting up virtual environment...
python -m venv %VENV_DIR%
call %VENV_DIR%\Scripts\activate.bat
pip3 show torch > nul
if %errorlevel% neq 0 (
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
)
echo Installing requirements...
pip install -r %REQUIREMENTS%
echo Setup complete.
echo Running the application...
call %VENV_DIR%\Scripts\activate.bat

25
build_run.bat Normal file
View File

@ -0,0 +1,25 @@
@echo off
setlocal
set VENV_DIR=venv
set REQUIREMENTS=requirements.txt
echo Setting up virtual environment...
python -m venv %VENV_DIR%
call %VENV_DIR%\Scripts\activate.bat
pip3 show torch > nul
if %errorlevel% neq 0 (
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
)
echo Installing requirements...
pip install -r %REQUIREMENTS%
echo Setup complete.
echo Running the application...
call %VENV_DIR%\Scripts\activate.bat
python main.py