forked from machinewrapped/llm-subtrans
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
60 lines (48 loc) · 1.5 KB
/
install.bat
File metadata and controls
60 lines (48 loc) · 1.5 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 enabledelayedexpansion
echo Checking if Python 3 is installed...
python --version >nul 2>&1
if errorlevel 1 (
echo Python 3 not found. Please install Python 3 and try again.
exit /b 1
)
echo Checking if "envsubtrans" folder exists...
if exist envsubtrans (
echo "envsubtrans" folder exists. Please delete it to continue with the installation.
exit /b 1
)
echo Creating and activating virtual environment "envsubtrans"...
python -m venv envsubtrans
call envsubtrans\Scripts\activate.bat
echo Installing requirements from "requirements.txt"...
pip install -r requirements.txt
echo Please enter your OpenAI API key:
set /p api_key=API_KEY:
if not "!api_key!"=="" (
echo API_KEY=!api_key! > .env
echo API key saved to .env
)
echo Please enter your OpenAI API host(Leave blank for default: https://api.openai.com/v1):
set /p api_base=API_BASE:
if not "!api_base!"=="" (
echo API_BASE=!api_base! >> .env
echo API base saved to .env
)
echo Are you on the free plan? (Y/N)
set /p free_plan=Free plan?:
if /i "!free_plan!"=="Y" (
set add_limits=1
) else if /i "!free_plan!"=="Yes" (
set add_limits=1
) else (
set add_limits=0
)
if "!add_limits!"=="1" (
echo MAX_THREADS=1 >> .env
echo RATE_LIMIT=5 >> .env
echo Warning: Translation speed will be severely limited due to the free plan limitations.
echo If you upgrade your plan, rerun the script to update your settings.
)
echo Installation complete.
echo To uninstall, simply delete the directory.
exit /b 0