2024-06-30 22:06:23 +02:00
|
|
|
#!/bin/bash
|
|
|
|
source ../utils.sh
|
|
|
|
python_exec=venv/bin/python3.10
|
|
|
|
|
2024-08-10 21:39:51 +02:00
|
|
|
# Function to install/update StableDiffusion
|
2024-06-30 22:06:23 +02:00
|
|
|
install_xtts() {
|
|
|
|
if [ -d "webui" ]; then
|
|
|
|
echo "XTTS repository already exists. Skipping clone."
|
2024-08-10 21:39:51 +02:00
|
|
|
yes_or_no "Do you want to update XTTS WebUI ?" && {
|
|
|
|
cd webui
|
2024-08-10 22:02:59 +02:00
|
|
|
rm requirements_without_torch.txt
|
2024-08-10 21:39:51 +02:00
|
|
|
git pull
|
|
|
|
echo "XTTS WebUI successfully updated."
|
2024-08-10 22:02:59 +02:00
|
|
|
cd ..
|
2024-08-10 21:39:51 +02:00
|
|
|
}
|
2024-06-30 22:06:23 +02:00
|
|
|
else
|
|
|
|
echo "Cloning XTTS repository..."
|
|
|
|
git clone https://github.com/daswer123/xtts-webui webui
|
|
|
|
fi
|
|
|
|
|
2024-08-10 22:02:59 +02:00
|
|
|
iconv -f UTF-16 -t UTF-8 webui/requirements.txt | grep -v 'torch' > webui/requirements_without_torch.txt
|
2024-06-30 22:06:23 +02:00
|
|
|
$python_exec -m pip install -r webui/requirements_without_torch.txt
|
|
|
|
|
|
|
|
# Disable gpu for faster-whipser as ROCM isn't supported yet
|
|
|
|
sed -i 's/device = "cuda" if torch.cuda.is_available() else "cpu"/device = "cpu"/' webui/scripts/utils/formatter.py
|
|
|
|
sed -i 's/asr_model = WhisperModel(whisper_model, device=device, compute_type="float16")/asr_model = WhisperModel(whisper_model, device=device, compute_type="int8")/' webui/scripts/utils/formatter.py
|
|
|
|
|
|
|
|
# Deepspeed and ninja (not working)
|
2024-08-19 18:35:27 +02:00
|
|
|
$python_exec -m pip install ninja deepspeed
|
2024-06-30 22:06:23 +02:00
|
|
|
# apt-get install -y ninja-build
|
2024-08-19 18:35:27 +02:00
|
|
|
|
|
|
|
ln -S webui/models models
|
2024-06-30 22:06:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Main function
|
|
|
|
main() {
|
|
|
|
prepare_env
|
|
|
|
|
|
|
|
# Install XTTS
|
|
|
|
install_xtts
|
|
|
|
|
|
|
|
clean
|
|
|
|
|
2024-08-10 21:39:51 +02:00
|
|
|
echo "XTTS installation/update complete."
|
2024-06-30 22:06:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Run main function
|
|
|
|
main
|