forked from cyberofficial/Synthalingua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bash
executable file
·52 lines (41 loc) · 1.45 KB
/
setup.bash
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
#!/bin/bash
# Realtime Whisper Translation App setup script
echo "Realtime Whisper Translation App"
if [ -d "data_whisper" ]; then
echo -n "Python environment already exists. Do you want to reinstall? [y/n]: "
read reinstall
if [ "$reinstall" == "y" ] || [ "$reinstall" == "Y" ]; then
echo "Deleting existing environment..."
source data_whisper/bin/deactivate
rm -rf data_whisper
else
echo "Exiting..."
exit 0
fi
fi
echo "Creating python environment..."
python -m venv data_whisper
echo "Created Env..."
source data_whisper/bin/activate
echo "Installing Whisper"
echo "Updating pip"
python -m pip install --upgrade pip
echo "Installing Requirements..."
pip install wheel
pip install setuptools-rust
pip install -r requirements_static.txt
echo "Fixing CUDA Since Whisper installs non-gpu version."
pip uninstall --yes torch torchvision torchaudio
pip cache purge
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
echo "Setup Completed!"
echo "Creating example shortcut in $(pwd)"
echo "You can edit with any text editor anytime."
echo ""
echo '#!/bin/bash' > livetranslation.sh
echo "source \"$(pwd)/data_whisper/bin/activate\"" >> livetranslation.sh
echo "python \"$(pwd)/transcribe_audio.py\" --ram 4gb --non_english --translate" >> livetranslation.sh
# add a pause
echo "read -p \"Press enter to exit...\"" >> livetranslation.sh
chmod +x livetranslation.sh
echo "Done!"