-
Notifications
You must be signed in to change notification settings - Fork 29
/
setup.bat
67 lines (50 loc) · 1.62 KB
/
setup.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
57
58
59
60
61
62
63
64
65
66
67
@echo off
REM Set the console window size to 80 columns by 25 lines
mode con lines=25
echo ===========================================
echo S E T T I N G U P E N V I R O N M E N T
echo ===========================================
git pull
rem Check if python is installed
where python
if %errorlevel% neq 0 (
echo Python is not installed on this computer. Please install Python and run this script again.
pause
exit /b
)
rem Check if virtualenv is installed
pip show virtualenv
if %errorlevel% neq 0 (
echo virtualenv is not installed on this computer. Installing virtualenv...
pip install virtualenv
)
rem Create the virtual environment
python -m venv venv
rem Activate the virtual environment
call venv\Scripts\activate
rem Install the required packages
pip install -r requirements.txt
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
pip install --upgrade transformers
rem clear console
cls
rem echo Set up Complete
rem echo Configure your .env file then launch run.bat
rem echo or run using "python discordbot.py <DISCORD_BOT_TOKEN> <ENDPOINT> <CHANNEL_ID>"
REM Check if .env file exists
if not exist .env (
echo ===========================================
echo S E T U P C O M P L E T E
echo ===========================================
echo.
echo Configure your .env file then launch run.bat
echo.
echo or run using "python discordbot.py"
pause
exit /b
)
REM load the virtual environment
call venv\Scripts\activate
REM Run the Python script with the environment variables as arguments
python discordbot.py
pause