-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.bat
72 lines (59 loc) · 1.94 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
68
69
70
71
72
@echo off
setlocal enabledelayedexpansion
Title Realtime Whisper Translation App Setup
:check_python
echo Checking for Python installation...
where python >nul 2>&1
if !errorlevel! neq 0 (
echo Python is not installed or not in the PATH. Please install Python before continuing.
exit /b
)
:prepare_environment
cls
if exist "data_whisper" (
set /p reinstall="Python environment 'data_whisper' already exists. Reinstall it? [Y/N]: "
if /i "!reinstall!"=="Y" (
echo Deleting existing environment...
rmdir /s /q data_whisper
) else (
echo Operation cancelled by user.
pause
exit /b
)
)
echo Creating a new Python virtual environment...
python -m venv data_whisper
echo Activating the environment...
call data_whisper\Scripts\activate.bat
:install_dependencies
echo Upgrading pip to the latest version...
python.exe -m pip install --upgrade pip
echo Installing wheel and setuptools-rust...
pip install wheel
pip install setuptools-rust
echo Checking for 'requirements.txt'...
if not exist "requirements.txt" (
echo 'requirements.txt' not found. Please ensure it is in the current directory.
exit /b
)
echo Installing requirements from 'requirements.txt'...
pip install -r requirements.txt
:cuda_patch
echo Applying CUDA patch to install GPU versions of PyTorch packages...
pip uninstall --yes torch torchvision torchaudio
pip cache purge
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
echo Whisper translation environment setup completed!
:create_shortcut
echo Creating a shortcut batch file for the translation app...
(
echo @echo off
echo cls
echo call "data_whisper\Scripts\activate.bat"
echo python "transcribe_audio.py" --ram 4gb --non_english --translate
echo pause
) > "livetranslation.bat"
echo Shortcut 'livetranslation.bat' created in the current directory.
echo You can edit this file with notepad if necessary.
pause
exit /b