Updated atsetup.sh

This commit is contained in:
erew123 authored and GitHub committed 2024-01-12 11:30:12 +00:00
1 parent 697fb098c3
commit 36bfb17eda
1 file changed
+70 -30
+70 -30
View File
@@ -1,9 +1,19 @@
#!/bin/bash #!/bin/bash
# ANSI color codes # ANSI color codes
RED='\033[1;34m' RED='\033[1;31m'
GREEN='\033[1;32m' GREEN='\033[1;32m'
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
BLUE='\033[1;34m'
CYAN='\033[1;36m'
MAGENTA='\033[1;35m'
WHITE='\033[1;37m'
L_RED='\033[1;91m'
L_GREEN='\033[1;92m'
L_YELLOW='\033[1;93m'
L_BLUE='\033[1;94m'
L_CYAN='\033[1;96m'
L_MAGENTA='\033[1;95m'
NC='\033[0m' # No Color NC='\033[0m' # No Color
# Navigate to the script's directory # Navigate to the script's directory
@@ -23,14 +33,13 @@ main_menu() {
while true; do while true; do
clear clear
echo echo
echo "Welcome to the AllTalk Setup Utility" echo -e " ${L_BLUE}ALLTALK LINUX SETUP UTILITY${NC}"
echo echo
echo "Please select an option:" echo " INSTALLATION TYPE"
echo -e " 1) I am using AllTalk as part of ${L_GREEN}Text-generation-webui${NC}"
echo -e " 2) I am using AllTalk as a ${L_GREEN}Standalone Application${NC}"
echo echo
echo " 1) I am using AllTalk as part of Text-generation-webui" echo -e " 9)${L_RED} Exit/Quit${NC}"
echo " 2) I am using AllTalk as a Standalone Application"
echo
echo " 9) Exit/Quit"
echo echo
read -p " Enter your choice: " user_option read -p " Enter your choice: " user_option
@@ -48,19 +57,25 @@ webui_menu() {
while true; do while true; do
clear clear
echo echo
echo "You have selected Text-generation-webui." echo -e " ${L_BLUE}TEXT-GENERATION-WEBUI SETUP${NC}"
echo echo
echo -e "Please ensure you have started your Text-generation-webui Python environment." echo -e " Please ensure you have started your Text-generation-webui Python"
echo -e "If you have NOT done this, please run ${GREEN}/cmd_linux.sh${NC} in the ${GREEN}text-generation-webui${NC} folder and then re-run this script." echo -e " environment. If you have NOT done this, please run ${L_GREEN}/cmd_linux.sh${NC}"
echo -e " in the ${L_GREEN}text-generation-webui${NC} folder and then re-run this script."
echo echo
echo " 1) Install the requirements for a Nvidia machine." echo " BASE REQUIREMENTS"
echo " 2) Install the requirements for an AMD or MAC machine." echo -e " 1) Install the AllTalk requirements for an ${L_GREEN}Nvidia GPU machine.${NC}"
echo -e " 2) Install the AllTalk requirements for an ${L_GREEN}AMD or MAC machine.${NC}"
echo
echo " OPTIONAL"
echo " 3) Install the Finetuning requirements." echo " 3) Install the Finetuning requirements."
echo " 4) Install DeepSpeed." echo " 4) Install DeepSpeed."
echo " 5) Uninstall DeepSpeed." echo " 5) Uninstall DeepSpeed."
echo
echo " OTHER"
echo " 6) Generate a diagnostics file." echo " 6) Generate a diagnostics file."
echo echo
echo " 9) Back to Main Menu" echo -e " 9)${L_RED} Exit/Quit${NC}"
echo echo
read -p " Enter your choice: " webui_option read -p " Enter your choice: " webui_option
@@ -71,7 +86,7 @@ webui_menu() {
4) install_deepspeed ;; 4) install_deepspeed ;;
5) uninstall_deepspeed ;; 5) uninstall_deepspeed ;;
6) generate_diagnostics_textgen ;; 6) generate_diagnostics_textgen ;;
9) break ;; 9) exit 0 ;;
*) echo "Invalid option"; sleep 2 ;; *) echo "Invalid option"; sleep 2 ;;
esac esac
done done
@@ -117,7 +132,14 @@ install_finetune_textgen() {
echo echo
return return
fi fi
echo "Finetune requirements installed successfully." echo
echo " Finetune base requirements installed successfully."
echo
echo -e " Finetuning requires access to ${GREEN}Cublas${NC} from the ${GREEN}Nvidia CUDA Toolkit${NC}, so will need installing."
echo
echo -e " Instructions can be found here:"
echo -e " ${GREEN}https://github.com/erew123/alltalk_tts?#-finetuning-a-model${NC}"
echo
read -p " Press any key to continue. " -n 1 read -p " Press any key to continue. " -n 1
echo echo
} }
@@ -125,13 +147,20 @@ install_finetune_textgen() {
# Function to install DeepSpeed # Function to install DeepSpeed
install_deepspeed() { install_deepspeed() {
clear clear
echo -e "${YELLOW}DeepSpeed Installation Prerequisites:${NC}"
echo echo
echo -e " 1. NVIDIA CUDA Toolkit must be installed from ${GREEN}https://developer.nvidia.com/cuda-toolkit-archive${NC} or your ${GREEN}Linux package manager${NC}." echo -e " ${L_BLUE}DEEPSPEED INSTALLATION REQUIREMENTS${NC}"
echo -e " 2. ${GREEN}libaio-dev${NC} must be installed." echo
echo -e " 3. The environment variable ${GREEN}CUDA_HOME${NC} must be set (e.g. export CUDA_HOME=/usr/local/cuda)." echo -e " - NVIDIA CUDA Toolkit must be installed from your ${L_GREEN}Linux package manager${NC}"
echo -e " or ${L_GREEN}https://developer.nvidia.com/cuda-toolkit-archive${NC}"
echo -e "\n${RED}Please confirm that you have completed these steps before continuing with the DeepSpeed installation.${NC}" echo -e " - The environment variable ${L_GREEN}CUDA_HOME${NC} must be set in your Python env"
echo -e " e.g. export CUDA_HOME=/usr/local/cuda."
echo -e " - ${L_GREEN}libaio-dev${NC} must be installed."
echo
echo -e " See the following link for full instructions:"
echo -e " ${L_GREEN}https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options${NC}"
echo
echo -e " ${L_BLUE}Please ${L_RED}confirm${L_BLUE} that you have completed these steps before continuing"
echo -e " with the DeepSpeed installation, or the install ${L_RED}will fail.${NC}"
echo echo
read -p " Have you completed all the above steps? (y/n): " confirm read -p " Have you completed all the above steps? (y/n): " confirm
@@ -185,15 +214,20 @@ standalone_menu() {
while true; do while true; do
clear clear
echo echo
echo "You have selected Standalone Application Setup." echo -e " ${L_BLUE}ALLTALK STANDALONE APPLICATION SETUP${NC}"
echo echo
echo " 1) Install AllTalk's custom Python environment (Setup AllTalk as a standalone Application)" echo " BASE REQUIREMENTS"
echo " 1) Install AllTalk as a Standalone Application"
echo
echo " OPTIONAL"
echo " 2) Delete AllTalk's custom Python environment" echo " 2) Delete AllTalk's custom Python environment"
echo " 3) Install the Finetuning requirements" echo " 3) Install the Finetuning requirements"
echo " 4) Install DeepSpeed." echo " 4) Install DeepSpeed."
echo
echo " OTHER"
echo " 5) Generate a diagnostics file" echo " 5) Generate a diagnostics file"
echo echo
echo " 9) Back to Main Menu" echo -e " 9)${L_RED} Exit/Quit${NC}"
echo echo
read -p " Enter your choice: " standalone_option read -p " Enter your choice: " standalone_option
@@ -203,7 +237,7 @@ standalone_menu() {
3) install_finetune_standalone ;; 3) install_finetune_standalone ;;
4) install_deepspeed ;; 4) install_deepspeed ;;
5) generate_diagnostics_standalone ;; 5) generate_diagnostics_standalone ;;
9) break ;; 9) exit 0 ;;
*) echo "Invalid option"; sleep 2 ;; *) echo "Invalid option"; sleep 2 ;;
esac esac
done done
@@ -252,7 +286,7 @@ install_custom_standalone() {
conda activate "${INSTALL_ENV_DIR}" conda activate "${INSTALL_ENV_DIR}"
echo echo
echo "Choose the type of requirements to install:" echo -e " ${L_BLUE}Choose the type of requirements to install${NC}"
echo echo
echo " 1. Nvidia graphics card machines" echo " 1. Nvidia graphics card machines"
echo " 2. Other machines (mac, amd, etc)" echo " 2. Other machines (mac, amd, etc)"
@@ -291,8 +325,8 @@ EOF
chmod +x start_alltalk.sh chmod +x start_alltalk.sh
echo echo
echo echo
echo "start_alltalk.sh has been created." echo -e " start_alltalk.sh has been created."
echo -e "You can now start AllTalk with ${YELLOW}./start_alltalk.sh${NC}" echo -e " You can now start AllTalk with ${L_YELLOW}./start_alltalk.sh${NC}"
echo echo
read -p " Press any key to continue. " -n 1 read -p " Press any key to continue. " -n 1
} }
@@ -346,12 +380,18 @@ install_finetune_standalone() {
echo echo
return return
fi fi
echo "Finetune requirements installed successfully." echo
echo " Finetune base requirements installed successfully."
echo
echo -e " Finetuning requires access to ${GREEN}Cublas${NC} from the ${GREEN}Nvidia CUDA Toolkit${NC}, so will need installing."
echo
echo -e " Instructions can be found here:"
echo -e " ${GREEN}https://github.com/erew123/alltalk_tts?#-finetuning-a-model${NC}"
echo
read -p " Press any key to continue. " -n 1 read -p " Press any key to continue. " -n 1
echo echo
} }
generate_diagnostics_standalone() { generate_diagnostics_standalone() {
local env_dir="$PWD/alltalk_environment" local env_dir="$PWD/alltalk_environment"
local conda_root_prefix="${env_dir}/conda" local conda_root_prefix="${env_dir}/conda"