From 102424669bea46588712e98fd8cf611d9c287afb Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sat, 13 Jan 2024 11:31:22 +0000 Subject: [PATCH 01/44] Update tts_server.py - URL file path no timestamp --- tts_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tts_server.py b/tts_server.py index 55adf7e..e41e1ee 100644 --- a/tts_server.py +++ b/tts_server.py @@ -936,8 +936,8 @@ def combine(output_file_timestamp, output_file_name, audio_files): output_cache_url = f'http://{params["ip_address"]}:{params["port_number"]}/audiocache/{output_file_name}_{timestamp}_combined.wav' else: output_file_path = os.path.join(this_dir / "outputs" / f'{output_file_name}_combined.wav') - output_file_url = f'http://{params["ip_address"]}:{params["port_number"]}/audio/{output_file_name}.wav' - output_cache_url = f'http://{params["ip_address"]}:{params["port_number"]}/audiocache/{output_file_name}.wav' + output_file_url = f'http://{params["ip_address"]}:{params["port_number"]}/audio/{output_file_name}_combined.wav' + output_cache_url = f'http://{params["ip_address"]}:{params["port_number"]}/audiocache/{output_file_name}_combined.wav' try: sf.write(output_file_path, audio, samplerate=sample_rate) # Clean up unnecessary files From e43c58a56e3667d49a6554c17399d90de032a77d Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sat, 13 Jan 2024 13:09:20 +0000 Subject: [PATCH 02/44] Delete atstart.sh --- atstart.sh | 381 ----------------------------------------------------- 1 file changed, 381 deletions(-) delete mode 100644 atstart.sh diff --git a/atstart.sh b/atstart.sh deleted file mode 100644 index 6785cf4..0000000 --- a/atstart.sh +++ /dev/null @@ -1,381 +0,0 @@ -#!/bin/bash - -# ANSI color codes -RED='\033[1;34m' -GREEN='\033[1;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -# Navigate to the script's directory -cd "$(dirname "$0")" - -# Function to check if curl is installed -check_curl() { - if ! command -v curl &> /dev/null; then - echo "curl is not available on this system. Please install curl then re-run the script https://curl.se/" - echo "or perform a manual installation of a Conda Python environment." - exit 1 - fi -} - -# Main Menu -main_menu() { - while true; do - clear - echo - echo "Welcome to the AllTalk Setup Utility" - echo - echo "Please select an option:" - echo - echo " 1) I am using AllTalk as part of Text-generation-webui" - echo " 2) I am using AllTalk as a Standalone Application" - echo - echo " 9) Exit/Quit" - echo - read -p "Enter your choice: " user_option - - case $user_option in - 1) webui_menu ;; - 2) standalone_menu ;; - 9) exit 0 ;; - *) echo "Invalid option"; sleep 2 ;; - esac - done -} - -# Text-generation-webui Menu -webui_menu() { - while true; do - clear - echo - echo "You have selected Text-generation-webui." - echo - echo -e "Please ensure you have started your Text-generation-webui Python environment." - 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 - echo " 1) Install the requirements for a Nvidia machine." - echo " 2) Install the requirements for an AMD or MAC machine." - echo " 3) Install the Finetuning requirements." - echo " 4) Install DeepSpeed." - echo " 5) Uninstall DeepSpeed." - echo " 6) Generate a diagnostics file." - echo - echo " 9) Back to Main Menu" - echo - read -p "Enter your choice: " webui_option - - case $webui_option in - 1) install_nvidia_textgen ;; - 2) install_other_textgen ;; - 3) install_finetune_textgen ;; - 4) install_deepspeed ;; - 5) uninstall_deepspeed ;; - 6) generate_diagnostics_textgen ;; - 9) break ;; - *) echo "Invalid option"; sleep 2 ;; - esac - done -} - -install_nvidia_textgen() { - local requirements_file="requirements_nvidia.txt" - echo "Installing Finetune requirements from $requirements_file..." - if ! pip install -r "$requirements_file"; then - echo "There was an error installing the Nvidia requirements." - echo "Please check the output for details." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - echo "Nvidia requirements installed successfully." - read -p "Press any key to continue. " -n 1 - echo -} - -install_other_textgen() { - local requirements_file="requirements_other.txt" - echo "Installing Other machine requirements from $requirements_file..." - if ! pip install -r "$requirements_file"; then - echo "There was an error installing the Other requirements." - echo "Please check the output for details." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - echo "Other machine requirements installed successfully." - read -p "Press any key to continue. " -n 1 - echo -} - -install_finetune_textgen() { - local requirements_file="requirements_finetune.txt" - echo "Installing Finetune requirements from $requirements_file..." - if ! pip install -r "$requirements_file"; then - echo "There was an error installing the Finetune requirements." - echo "Please check the output for details." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - echo "Finetune requirements installed successfully." - read -p "Press any key to continue. " -n 1 - echo -} - -# Function to install DeepSpeed -install_deepspeed() { - clear - echo -e "${YELLOW}DeepSpeed Installation Prerequisites:${NC}" - 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 " 2. ${GREEN}libaio-dev${NC} must be installed." - echo -e " 3. The environment variable ${GREEN}CUDA_HOME${NC} must be set (e.g. export CUDA_HOME=/usr/local/cuda)." - - echo -e "\n${RED}Please confirm that you have completed these steps before continuing with the DeepSpeed installation.${NC}" - echo - read -p "Have you completed all the above steps? (y/n): " confirm - - if [ "$confirm" != "y" ]; then - echo -e "${RED}DeepSpeed installation cannot proceed without completing the prerequisites.${NC}" - return - fi - - echo -e "\n${GREEN}Proceeding with DeepSpeed installation...${NC}" - pip install deepspeed - if [ $? -ne 0 ]; then - echo -e "${RED}There was an error installing DeepSpeed.${NC}" - return - fi - - echo -e "${GREEN}DeepSpeed installed successfully.${NC}" - read -p "Press any key to continue. " -n 1 - echo -} - -uninstall_deepspeed() { - echo "Uninstalling DeepSpeed..." - pip uninstall -y deepspeed - if [ $? -ne 0 ]; then - echo "There was an error uninstalling DeepSpeed." - echo "Press any key to return to the menu." - read -n 1 - return - fi - echo "DeepSpeed uninstalled successfully." - echo "Press any key to continue." - read -n 1 -} - -generate_diagnostics_textgen() { - # Run diagnostics - if ! python diagnostics.py; then - echo "There was an error running diagnostics." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - - echo "Diagnostics completed successfully." - read -p "Press any key to continue. " -n 1 - echo -} - -# Standalone Menu -standalone_menu() { - while true; do - clear - echo - echo "You have selected Standalone Application Setup." - echo - echo " 1) Install AllTalk's custom Python environment (Setup AllTalk as a standalone Application)" - echo " 2) Delete AllTalk's custom Python environment" - echo " 3) Install the Finetuning requirements" - echo " 4) Install DeepSpeed." - echo " 5) Generate a diagnostics file" - echo - echo " 9) Back to Main Menu" - echo - read -p "Enter your choice: " standalone_option - - case $standalone_option in - 1) install_custom_standalone ;; - 2) delete_custom_standalone ;; - 3) install_finetune_standalone ;; - 4) install_deepspeed ;; - 5) generate_diagnostics_standalone ;; - 9) break ;; - *) echo "Invalid option"; sleep 2 ;; - esac - done -} - -install_custom_standalone() { - cd "$(dirname "${BASH_SOURCE[0]}")" - - if [[ "$(pwd)" =~ " " ]]; then - echo "This script relies on Miniconda which can not be silently installed under a path with spaces." - exit - fi - - # Deactivate existing conda envs as needed to avoid conflicts - { conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null - - OS_ARCH=$(uname -m) - case "${OS_ARCH}" in - x86_64*) OS_ARCH="x86_64" ;; - arm64* | aarch64*) OS_ARCH="aarch64" ;; - *) echo "Unknown system architecture: $OS_ARCH! This script runs only on x86_64 or arm64" && exit ;; - esac - - # Config - INSTALL_DIR="$(pwd)/alltalk_environment" - CONDA_ROOT_PREFIX="${INSTALL_DIR}/conda" - INSTALL_ENV_DIR="${INSTALL_DIR}/env" - MINICONDA_DOWNLOAD_URL="https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Linux-${OS_ARCH}.sh" - - if [ ! -x "${CONDA_ROOT_PREFIX}/bin/conda" ]; then - echo "Downloading Miniconda from $MINICONDA_DOWNLOAD_URL to ${INSTALL_DIR}/miniconda_installer.sh" - mkdir -p "${INSTALL_DIR}" - curl -L "${MINICONDA_DOWNLOAD_URL}" -o "${INSTALL_DIR}/miniconda_installer.sh" - chmod +x "${INSTALL_DIR}/miniconda_installer.sh" - bash "${INSTALL_DIR}/miniconda_installer.sh" -b -p "${CONDA_ROOT_PREFIX}" - echo "Miniconda installed." - fi - - if [ ! -d "${INSTALL_ENV_DIR}" ]; then - "${CONDA_ROOT_PREFIX}/bin/conda" create -y --prefix "${INSTALL_ENV_DIR}" python=3.11 - echo "Conda environment created at ${INSTALL_ENV_DIR}." - fi - - # Activate the environment and install requirements - source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh" - conda activate "${INSTALL_ENV_DIR}" - - echo - echo "Choose the type of requirements to install:" - echo - echo " 1. Nvidia graphics card machines" - echo " 2. Other machines (mac, amd, etc)" - echo - read -p "Enter your choice (1 or 2): " user_choice - - if [ "$user_choice" == "1" ]; then - pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --upgrade --force-reinstall --index-url https://download.pytorch.org/whl/cu121 - pip install numpy==1.24.4 - pip install typing-extensions>=4.8.0 - pip install networkx<3.0.0,>=2.5.0 - pip install fsspec>=2023.6.0 - pip install soundfile==0.12.1 - pip install uvicorn==0.24.0.post1 - pip install TTS==0.21.3 - pip install fastapi==0.104.1 - pip install Jinja2==3.1.2 - pip install requests==2.31.0 - pip install tqdm==4.66.1 - pip install importlib-metadata==4.8.1 - pip install packaging==23.2 - pip install pydantic==1.10.13 - pip install sounddevice==0.4.6 - pip install python-multipart==0.0.6 - else - pip install -r requirements_other.txt - fi - - # Create start_alltalk.sh to run AllTalk - cat << EOF > start_alltalk.sh -#!/bin/bash -source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh" -conda activate "${INSTALL_ENV_DIR}" -python script.py -EOF - chmod +x start_alltalk.sh - echo - echo - echo "start_alltalk.sh has been created." - echo -e "You can now start AllTalk with ${YELLOW}./start_alltalk.sh${NC}" - echo - read -p "Press any key to continue. " -n 1 -} - - -delete_custom_standalone() { - local env_dir="$PWD/alltalk_environment" - # Check if the alltalk_environment directory exists - if [ ! -d "$env_dir" ]; then - echo "\"$env_dir\" directory does not exist. No need to delete." - read -p "Press any key to continue. " -n 1 - echo - return - fi - # Check if a Conda environment is active and deactivate it - if [ -n "$CONDA_PREFIX" ]; then - echo "Exiting the Conda environment. You may need to start ./atstart.sh again" - conda deactivate - fi - echo "Deleting \"$env_dir\". Please wait." - rm -rf "$env_dir" - if [ -d "$env_dir" ]; then - echo "Failed to delete \"$env_dir\" folder." - echo "Please make sure it is not in use and try again." - else - echo "Environment \"$env_dir\" deleted successfully." - fi - read -p "Press any key to continue. " -n 1 - echo -} - -install_finetune_standalone() { - local env_dir="$PWD/alltalk_environment" - local conda_root_prefix="${env_dir}/conda" - local install_env_dir="${env_dir}/env" - if [ ! -d "${install_env_dir}" ]; then - echo "The Conda environment at '${install_env_dir}' does not exist." - echo "Please install the environment before proceeding." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - source "${conda_root_prefix}/etc/profile.d/conda.sh" - conda activate "${install_env_dir}" - local requirements_file="requirements_finetune.txt" - echo "Installing Finetune requirements from $requirements_file..." - if ! pip install -r "$requirements_file"; then - echo "There was an error installing the Finetune requirements." - echo "Please check the output for details." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - echo "Finetune requirements installed successfully." - read -p "Press any key to continue. " -n 1 - echo -} - - -generate_diagnostics_standalone() { - local env_dir="$PWD/alltalk_environment" - local conda_root_prefix="${env_dir}/conda" - local install_env_dir="${env_dir}/env" - if [ ! -d "${install_env_dir}" ]; then - echo "The Conda environment at '${install_env_dir}' does not exist." - echo "Please install the environment before proceeding." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - source "${conda_root_prefix}/etc/profile.d/conda.sh" - conda activate "${install_env_dir}" - if ! python diagnostics.py; then - echo "There was an error running diagnostics." - read -p "Press any key to return to the menu. " -n 1 - echo - return - fi - echo "Diagnostics completed successfully." - read -p "Press any key to continue. " -n 1 - echo -} - - -# Start the main menu -main_menu From b8292da92f4d809ccd11a4732a7d93db812c2829 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sat, 13 Jan 2024 21:47:49 +0000 Subject: [PATCH 03/44] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aa312d7..b5dd62a 100644 --- a/README.md +++ b/README.md @@ -765,6 +765,7 @@ Generate a preview of a specified voice with hardcoded settings. JSON return `{"status": "lowvram-success"}` ### 🟠 TTS Generation Endpoint (Standard Generation) +Streaming endpoint details are further down the page. - URL: `http://127.0.0.1:7851/api/tts-generate`
- Method: `POST`
- Content-Type: `application/x-www-form-urlencoded`
@@ -872,7 +873,7 @@ Example JSON TTS Generation Response: `{"status":"generate-success","output_file_path":"C:\\text-generation-webui\\extensions\\alltalk_tts\\outputs\\myoutputfile_1704141936.wav","output_file_url":"http://127.0.0.1:7851/audio/myoutputfile_1704141936.wav","output_cache_url":"http://127.0.0.1:7851/audiocache/myoutputfile_1704141936.wav"}` -### 🟠 Example command lines (Streaming Generation) +### 🟠 TTS Generation Endpoint (Streaming Generation) Streaming TTS generation does NOT support Narration and will generate an audio stream. Streaming TTS speech JavaScript Example:
- URL: `http://localhost:7851/api/tts-generate-streaming`
- Method: `POST`
- Content-Type: `application/x-www-form-urlencoded`

From 62d1cc05d32b50d324a93960c8258b95ade8bc8c Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:43:41 +0000 Subject: [PATCH 04/44] Added cutlet and unidic-lite for Japanese --- atsetup.bat | 2 ++ requirements_nvidia.txt | 2 ++ requirements_other.txt | 2 ++ 3 files changed, 6 insertions(+) diff --git a/atsetup.bat b/atsetup.bat index b996754..21e4ce9 100644 --- a/atsetup.bat +++ b/atsetup.bat @@ -351,6 +351,8 @@ if "%UserChoice%" == "1" ( pip install pydantic==1.10.13 pip install sounddevice==0.4.6 pip install python-multipart==0.0.6 + pip install cutlet>=0.3.0 + pip install unidic-lite>=1.0.8 echo Downloading DeepSpeed... curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-12.7/deepspeed-0.12.7+d058d4b-cp311-cp311-win_amd64.whl echo Installing DeepSpeed... diff --git a/requirements_nvidia.txt b/requirements_nvidia.txt index b8d22e9..51d6d2a 100644 --- a/requirements_nvidia.txt +++ b/requirements_nvidia.txt @@ -13,3 +13,5 @@ packaging>=23.2 pydantic>=1.10.13 sounddevice>=0.4.6 python-multipart>=0.0.6 +cutlet>=0.3.0 +unidic-lite>=1.0.8 \ No newline at end of file diff --git a/requirements_other.txt b/requirements_other.txt index 6566ced..e0363f2 100644 --- a/requirements_other.txt +++ b/requirements_other.txt @@ -13,3 +13,5 @@ packaging>=23.2 pydantic>=1.10.13 sounddevice>=0.4.6 python-multipart>=0.0.6 +cutlet>=0.3.0 +unidic-lite>=1.0.8 \ No newline at end of file From ad0eab1224455af01239876a8be068948bc57077 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:45:01 +0000 Subject: [PATCH 05/44] Update atsetup.sh added cutlet and unidic-lite --- atsetup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/atsetup.sh b/atsetup.sh index 3700b82..2fded23 100644 --- a/atsetup.sh +++ b/atsetup.sh @@ -311,6 +311,8 @@ install_custom_standalone() { pip install pydantic==1.10.13 pip install sounddevice==0.4.6 pip install python-multipart==0.0.6 + pip install cutlet>=0.3.0 + pip install unidic-lite>=1.0.8 else pip install -r requirements_other.txt fi From d52dcf86d56286ade6272e92bc937db8fef2e28f Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sat, 13 Jan 2024 23:43:15 +0000 Subject: [PATCH 06/44] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b5dd62a..85e4c7a 100644 --- a/README.md +++ b/README.md @@ -406,6 +406,14 @@ Everything has been done to make this as simple as possible. At its simplest, yo #### ⚫ The audio you will use I would suggest that if its in an interview format, you cut out the interviewer speaking in audacity or your chosen audio editing package. You dont have to worry about being perfect with your cuts, the finetuning Step 1 will go and find spoken audio and cut it out for you. Is there is music over the spoken parts, for best quality you would cut out those parts, though its not 100% necessary. As always, try to avoid bad quality audio with noises in it (humming sounds, hiss etc). You can try something like [Audioenhancer](https://audioenhancer.ai/) to try clean up noisier audio. There is no need to down-sample any of the audio, all of that is handled for you. Just give the finetuning some good quality audio to work with. +#### ⚫ A note about anonymous training Telemetry information & disabling it +Portions of Coqui's TTS trainer scripts gather anonymous training information which you can disable. Their statement on this is listed [here](https://github.com/coqui-ai/Trainer?tab=readme-ov-file#anonymized-telemetry). Although I have tried to pass `TRAINER_TELEMETRY=0` through AllTalk, it appears you will have to set this manually if you wish to finetune on a non-internet enabled computer or disable the anonymous data being sent. You can do this by: + +- On Windows by typing `set TRAINER_TELEMETRY=0` +- On Linux & Mac by typing `export TRAINER_TELEMETRY=0` + +Before you start `finetune.py`. You will now be able to finetune offline and no anonymous training data will be sent. + #### ⚫ Important requirements CUDA 11.8 As mentioned you must have a small portion of the Nvidia CUDA Toolkit **11.8** installed. Not higher or lower versions. Specifically **11.8**. You do not have to uninstall any other versions, change any graphics drivers, reinstall torch or anything like that. This requirement is for Step1 of Finetuning. To keep the download+install as small as possible, you will need to: - Download the **xxx (network)** install of the Nvidia CUDA Toolkit 11.8 from [here](https://developer.nvidia.com/cuda-11-8-0-download-archive) From 893747c9a92e7814b84623cc955ff34cf917fed1 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sun, 14 Jan 2024 12:48:49 +0000 Subject: [PATCH 07/44] Add files via upload --- .github/ISSUE_TEMPLATE/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/ISSUE_TEMPLATE/FUNDING.yml diff --git a/.github/ISSUE_TEMPLATE/FUNDING.yml b/.github/ISSUE_TEMPLATE/FUNDING.yml new file mode 100644 index 0000000..6132bf2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FUNDING.yml @@ -0,0 +1 @@ +ko_fi: erew123 From 04e08c58b8a4d1a209fd0a1f40a14f1aa38ab1e8 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sun, 14 Jan 2024 12:50:57 +0000 Subject: [PATCH 08/44] Delete .github/ISSUE_TEMPLATE/FUNDING.yml --- .github/ISSUE_TEMPLATE/FUNDING.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/ISSUE_TEMPLATE/FUNDING.yml diff --git a/.github/ISSUE_TEMPLATE/FUNDING.yml b/.github/ISSUE_TEMPLATE/FUNDING.yml deleted file mode 100644 index 6132bf2..0000000 --- a/.github/ISSUE_TEMPLATE/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -ko_fi: erew123 From c78927b80a52a2718f7caa5df134c04918742970 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Sun, 14 Jan 2024 12:51:41 +0000 Subject: [PATCH 09/44] Create FND --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6132bf2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +ko_fi: erew123 From 08a04ba506864be27707edc60db91d82c5484a68 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:36:29 +0000 Subject: [PATCH 10/44] Added warning about starting from disk location --- .../tts_chunk_player/tts_chunk_player.html | 167 +++++++++--------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/templates/tts_chunk_player/tts_chunk_player.html b/templates/tts_chunk_player/tts_chunk_player.html index 4c5f7ec..61c36bd 100644 --- a/templates/tts_chunk_player/tts_chunk_player.html +++ b/templates/tts_chunk_player/tts_chunk_player.html @@ -6,7 +6,6 @@ AllTalk TTS Generator -