From 2e4d52170da64b5aefd0939081b049d626959108 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 12:53:13 +0000
Subject: [PATCH 01/61] Update README.md
---
README.md | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index fa07a40..357be16 100644
--- a/README.md
+++ b/README.md
@@ -505,25 +505,38 @@ def get_shm_size():
## 🟦 Running AllTalk as a standalone app
AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
-Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python 3.11.x.
+Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python **3.11.x**.
#### 🟦 (Option 1) I already have AllTalk installed as an extension of Text-generation-webui
If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
#### 🟦 (Option 2) I wish to do a custom install of AllTalk
-1) In your chosen disk location git clone this repository:
-`git clone https://github.com/erew123/alltalk_tts`
+#### 🔹 A very quick understanding of Python Environments.
+Different Python applications have different requirements, some of those requirement’s conflict with other Python applications requirements. To work around this problem, you can create different Python environments that remain separated from one another. A simple way of looking at Python environments, is just like how your house has different rooms for specific purposes (Kitchen, Bathroom, Bedroom etc). You can create a Python environment that is built/customised specifically for your current applications needs/purposes and will **not** interfere with any other Python applications environments/installations.
If you are adept at managing Python environments, have an existing Python environment and know that you won’t cause any conflicts by installing AllTalk's requirements within that Python environment, then load up your Python environment and install the requirements. For everyone else, here is a basic guide on installing AllTalk in its own custom Python environment (there will be small variations between OS's, but the principle is the same).
-2) Move into the **alltalk_tts** folder:
-`cd alltalk_tts`
+**Note:** A standard VENV can cause module path issues, hence Conda is the correct method to create a Python environment for AllTalk.
-3) If you have a custom Python environment, now is the time to load it!
+#### 🔹 Building a custom Python Environment with Miniconda
+1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
-4) Install one of the two requirements files. Whichever one of the two is correct for your machine type:
+2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
+
+3) In your `Anaconda Prompt` command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`
`cd myfiles`
`git clone https://github.com/erew123/alltalk_tts`
+
+4) Now we will create our custom Conda Python 3.11.5 environment and give it the name `alltalkenv` by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
+
+5) Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` Conda Python environment.
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
+
+5) **If you are NOT using an Nvidia card and Cuda, skip to step 6** We will need to force PyTorch to install with CUDA.
`pip cache purge` (Will clear out all current copies of downloads that pip has) `pip uninstall torch torchaudio` (Will uninstall the the current version of Torch and Torchaudio from the (alltalkenv) environment)
+You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
**CUDA 11.8** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` **CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`
+
+6) Install one of the two requirements files. Whichever one of the two is correct for your machine type:
+
+Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in. It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
From afe3b9fe0b590d9edb0921e83acd26b52e1a3162 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 12:58:16 +0000
Subject: [PATCH 02/61] Update README.md
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 357be16..235f00b 100644
--- a/README.md
+++ b/README.md
@@ -519,15 +519,15 @@ Different Python applications have different requirements, some of those require
#### 🔹 Building a custom Python Environment with Miniconda
1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
-2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
+2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
-3) In your `Anaconda Prompt` command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`
`cd myfiles`
`git clone https://github.com/erew123/alltalk_tts`
+3) In your `Anaconda Prompt` command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`
`cd myfiles`. So you will:
`git clone https://github.com/erew123/alltalk_tts`
4) Now we will create our custom Conda Python 3.11.5 environment and give it the name `alltalkenv` by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
-5) Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` Conda Python environment.
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
+5) Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` Conda Python environment:
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
-5) **If you are NOT using an Nvidia card and Cuda, skip to step 6** We will need to force PyTorch to install with CUDA.
`pip cache purge` (Will clear out all current copies of downloads that pip has) `pip uninstall torch torchaudio` (Will uninstall the the current version of Torch and Torchaudio from the (alltalkenv) environment)
+5) **If you are NOT using an Nvidia card and CUDA, skip to step 6** We will need to force PyTorch to install with CUDA. So perform the following:
`pip cache purge` (Will clear out all current copies of downloads that pip has) `pip uninstall torch torchaudio` (Will uninstall the the current version of Torch and Torchaudio from the `(alltalkenv)` environment)
You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
**CUDA 11.8** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` **CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`
6) Install one of the two requirements files. Whichever one of the two is correct for your machine type:
@@ -536,7 +536,7 @@ You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio
7) Start AllTalk with `python script.py`
-Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in. It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
+Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
From 28675c976c43b9e5a73071bd81bb08db6e22319c Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 13:02:28 +0000
Subject: [PATCH 03/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 235f00b..93b0196 100644
--- a/README.md
+++ b/README.md
@@ -527,8 +527,8 @@ Different Python applications have different requirements, some of those require
5) Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` Conda Python environment:
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
-5) **If you are NOT using an Nvidia card and CUDA, skip to step 6** We will need to force PyTorch to install with CUDA. So perform the following:
`pip cache purge` (Will clear out all current copies of downloads that pip has) `pip uninstall torch torchaudio` (Will uninstall the the current version of Torch and Torchaudio from the `(alltalkenv)` environment)
-You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
**CUDA 11.8** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` **CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`
+5) **If you are NOT using an Nvidia card and CUDA, skip to step 6** We will need to force PyTorch to install with CUDA. So perform the following:
`pip cache purge` (Clear the current Pip cache)
`pip uninstall torch torchaudio` (Uninstall Torch and Torchaudio from the `alltalkenv` environment)
+You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
**CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`
6) Install one of the two requirements files. Whichever one of the two is correct for your machine type:
From 9c4efdc135884974b7754b53b0716320761f72ba Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 13:03:49 +0000
Subject: [PATCH 04/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 93b0196..08beff8 100644
--- a/README.md
+++ b/README.md
@@ -530,7 +530,7 @@ Different Python applications have different requirements, some of those require
5) **If you are NOT using an Nvidia card and CUDA, skip to step 6** We will need to force PyTorch to install with CUDA. So perform the following:
`pip cache purge` (Clear the current Pip cache)
`pip uninstall torch torchaudio` (Uninstall Torch and Torchaudio from the `alltalkenv` environment)
You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
**CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`
-6) Install one of the two requirements files. Whichever one of the two is correct for your machine type:
+6) Move into the `alltalk_tts` folder and install one of the two requirements files. Whichever one of the two is correct for your machine type:
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
From 2e1709ab58645d65d7f892232eb85183943919d7 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 13:06:10 +0000
Subject: [PATCH 05/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 08beff8..ae69c95 100644
--- a/README.md
+++ b/README.md
@@ -521,7 +521,7 @@ Different Python applications have different requirements, some of those require
2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
-3) In your `Anaconda Prompt` command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`
`cd myfiles`. So you will:
`git clone https://github.com/erew123/alltalk_tts`
+3) In your `Anaconda Prompt` command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`. So you will:
`cd myfiles`
`git clone https://github.com/erew123/alltalk_tts`
4) Now we will create our custom Conda Python 3.11.5 environment and give it the name `alltalkenv` by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
From 863a7cd841cc1b71c57d054a1271e79b2414763b Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 13:08:45 +0000
Subject: [PATCH 06/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ae69c95..7bbe432 100644
--- a/README.md
+++ b/README.md
@@ -536,7 +536,7 @@ You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio
7) Start AllTalk with `python script.py`
-Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
+🔹Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
From 56a7ea1d8f0d9200f85c6e21d5d867c19a930fa0 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 5 Jan 2024 13:17:38 +0000
Subject: [PATCH 07/61] Update README.md
---
README.md | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
index 7bbe432..08c8d35 100644
--- a/README.md
+++ b/README.md
@@ -517,28 +517,26 @@ Different Python applications have different requirements, some of those require
**Note:** A standard VENV can cause module path issues, hence Conda is the correct method to create a Python environment for AllTalk.
#### 🔹 Building a custom Python Environment with Miniconda
-1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
+1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
-2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
+2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
-3) In your `Anaconda Prompt` command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`. So you will:
`cd myfiles`
`git clone https://github.com/erew123/alltalk_tts`
+3) In your Anaconda Prompt command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`. So you will:
-4) Now we will create our custom Conda Python 3.11.5 environment and give it the name `alltalkenv` by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
+4) Now we will create our custom Conda Python 3.11.5 environment and give it the name alltalkenv by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` environment. So type the following:
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
-5) Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` Conda Python environment:
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
+5) **If you are NOT using an Nvidia card and CUDA, skip to step 6**. To force PyTorch to install with CUDA, perform the following:
`pip cache purge` (Clear the current Pip cache)
`pip uninstall torch torchaudio` (Uninstall Torch and Torchaudio from the `alltalkenv` environment)
+You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
**CUDA 12.1** > `pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121`
-
-6) Move into the `alltalk_tts` folder and install one of the two requirements files. Whichever one of the two is correct for your machine type:
`cd alltalk_tts`
+6) Move into the alltalk_tts folder and install one of the two requirements files. Whichever one of the two is correct for your machine type:
🔹Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
-Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
+Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
## 🟠 API Suite and JSON-CURL
### 🟠Overview
From 3bc55a91e5d3533477b97ab788d99ffe2b863952 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 11:50:35 +0000
Subject: [PATCH 08/61] Added streaming API & Current settings endpoint
---
tts_server.py | 94 +++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 84 insertions(+), 10 deletions(-)
diff --git a/tts_server.py b/tts_server.py
index 55adf7e..ca69597 100644
--- a/tts_server.py
+++ b/tts_server.py
@@ -81,6 +81,17 @@ else:
f"[{params['branding']}Startup] \033[91mWarning\033[0m modeldownload.config is missing so please re-download it and save it in the alltalk_tts main folder."
)
+##################################################
+#### Check to see if a finetuned model exists ####
+##################################################
+# Set the path to the directory
+trained_model_directory = this_dir / "models" / "trainedmodel"
+# Check if the directory "trainedmodel" exists
+finetuned_model = trained_model_directory.exists()
+# If the directory exists, check for the existence of the required files
+if finetuned_model:
+ required_files = ["model.pth", "config.json", "vocab.json"]
+ finetuned_model = all((trained_model_directory / file).exists() for file in required_files)
########################
#### STARTUP CHECKS ####
@@ -98,19 +109,17 @@ except ModuleNotFoundError:
raise
# DEEPSPEED Import - Check for DeepSpeed and import it if it exists
+deepspeed_available = False
try:
import deepspeed
-
- deepspeed_installed = True
- print(f"[{params['branding']}Startup] DeepSpeed \033[93mDetected\033[0m")
- print(
- f"[{params['branding']}Startup] Activate DeepSpeed in {params['branding']} settings"
- )
+ deepspeed_available = True
except ImportError:
- deepspeed_installed = False
- print(
- f"[{params['branding']}Startup] DeepSpeed \033[93mNot Detected\033[0m. See https://github.com/microsoft/DeepSpeed"
- )
+ pass
+if deepspeed_available:
+ print(f"[{params['branding']}Startup] DeepSpeed \033[93mDetected\033[0m")
+ print(f"[{params['branding']}Startup] Activate DeepSpeed in {params['branding']} settings")
+else:
+ print(f"[{params['branding']}Startup] DeepSpeed \033[93mNot Detected\033[0m. See https://github.com/microsoft/DeepSpeed")
@asynccontextmanager
@@ -729,6 +738,11 @@ async def tts_demo_request(request: Request, text: str = Form(...), voice: str =
print(f"An error occurred: {e}")
return JSONResponse(content={"error": "An error occurred"}, status_code=500)
+
+#####################
+#### Audio feeds ####
+#####################
+
# Gives web access to the output files
@app.get("/audio/{filename}")
async def get_audio(filename: str):
@@ -808,6 +822,34 @@ import numpy as np
import soundfile as sf
import sys
+##############################
+#### Streaming Generation ####
+##############################
+
+@app.get("/api/tts-generate-streaming", response_class=StreamingResponse)
+async def tts_generate_streaming(text: str, voice: str, language: str, output_file: str):
+ try:
+ output_file_path = this_dir / "outputs" / output_file
+ stream = await generate_audio(text, voice, language, output_file_path, streaming=True)
+ return StreamingResponse(stream, media_type="audio/wav")
+ except Exception as e:
+ print(f"An error occurred: {e}")
+ return JSONResponse(content={"error": "An error occurred"}, status_code=500)
+
+@app.post("/api/tts-generate-streaming", response_class=JSONResponse)
+async def tts_generate_streaming(request: Request, text: str = Form(...), voice: str = Form(...), language: str = Form(...), output_file: str = Form(...)):
+ try:
+ output_file_path = this_dir / "outputs" / output_file
+ await generate_audio(text, voice, language, output_file_path, streaming=False)
+ return JSONResponse(content={"output_file_path": str(output_file)}, status_code=200)
+ except Exception as e:
+ print(f"An error occurred: {e}")
+ return JSONResponse(content={"error": "An error occurred"}, status_code=500)
+
+##############################
+#### Standard Generation ####
+##############################
+
# Check for PortAudio library on Linux
try:
import sounddevice as sd
@@ -1053,6 +1095,38 @@ async def tts_generate(
return JSONResponse(content={"status": "generate-failure", "error": "An error occurred"}, status_code=500)
+##########################
+#### Current Settings ####
+##########################
+# Define the available models
+models_available = [
+ {"name": "Coqui", "model_name": "API TTS"},
+ {"name": "Coqui", "model_name": "API Local"},
+ {"name": "Coqui", "model_name": "XTTSv2 Local"}
+]
+
+@app.get('/api/currentsettings')
+def get_current_settings():
+ # Determine the current model loaded
+ if params["tts_method_api_tts"]:
+ current_model_loaded = "API TTS"
+ elif params["tts_method_api_local"]:
+ current_model_loaded = "API Local"
+ elif params["tts_method_xtts_local"]:
+ current_model_loaded = "XTTSv2 Local"
+ else:
+ current_model_loaded = None # or a default value if no method is active
+
+ settings = {
+ "models_available": models_available,
+ "current_model_loaded": current_model_loaded,
+ "deepspeed_available": deepspeed_available,
+ "deepspeed_status": params["deepspeed_activate"],
+ "low_vram_status": params["low_vram"],
+ "finetuned_model": finetuned_model
+ }
+ return settings # Automatically converted to JSON by Fas
+
#############################
#### Word Add-in Sharing ####
#############################
From 81c8354cf8f7af637ee7991ea07549ea812963de Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 11:53:49 +0000
Subject: [PATCH 09/61] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 72baa97..3a46ea4 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
- **Console output:** Clear command line output for any warnings or issues.
- **API Suite and 3rd Party support via JSON calls:** Can be used with 3rd party applications via JSON calls.
+- **SillyTavern integration:** Full integration with SillyTavern.
## Index
@@ -34,7 +35,8 @@ Please check the below link to find a list of all recent updates and changes.
## 🟩 Installation on Text generation web UI
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
-If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
+If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
+If you wish to install AllTalk as a standalone application without Text-generation-webui, please go to [this link here](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
`cd text-generation-webui`
From 621f5434a76478ed9764efbb14d98a5d902bfe4f Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 12:38:59 +0000
Subject: [PATCH 10/61] Update README.md
---
README.md | 45 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 41 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 3a46ea4..ac7f619 100644
--- a/README.md
+++ b/README.md
@@ -602,6 +602,22 @@ Retrieve a list of available voices for generating speech.
JSON return: `{"voices": ["voice1.wav", "voice2.wav", "voice3.wav"]}`
+#### 🟠 Current Settings Endpoint
+Retrieve a list of available voices for generating speech.
+
+- URL: `http://127.0.0.1:7851/api/currentsettings` - Method: `GET`
+
+ `curl -X GET "http://127.0.0.1:7851/api/currentsettings"`
+
+ JSON return: `{"models_available":[{"name":"Coqui","model_name":"API TTS"},{"name":"Coqui","model_name":"API Local"},{"name":"Coqui","model_name":"XTTSv2 Local"}],"current_model_loaded":"XTTSv2 Local","deepspeed_available":true,"deepspeed_status":true,"low_vram_status":true,"finetuned_model":false}
+
+ name & model_name = listing the currently available models.
+ current_model_loaded = what model is currently loaded into VRAM.
+ deepspeed_available = was DeepSpeed detected on startup and available to be activated.
+ deepspeed_status = If DeepSpeed was detected, is it currently activated.
+ low_vram_status = Is Low VRAM currently enabled.
+ finetuned_model = Was a finetuned model detected. (XTTSv2 FT).
+
#### 🟠 Preview Voice Endpoint
Generate a preview of a specified voice with hardcoded settings.
@@ -650,8 +666,8 @@ Generate a preview of a specified voice with hardcoded settings.
- URL: `http://127.0.0.1:7851/api/tts-generate` - Method: `POST` - Content-Type: `application/x-www-form-urlencoded`
-### 🟠 Example command lines
-Standard TTS speech Example (standard text) generating a time-stamped file
+### 🟠 Example command lines (Standard Generation)
+Standard TTS generation supports Narration and will generate a wav file/blob. Standard TTS speech Example (standard text) generating a time-stamped file
`curl -X POST "http://127.0.0.1:7851/api/tts-generate" -d "text_input=All of this is text spoken by the character. This is text not inside quotes, though that doesnt matter in the slightest" -d "text_filtering=standard" -d "character_voice_gen=female_01.wav" -d "narrator_enabled=false" -d "narrator_voice_gen=male_01.wav" -d "text_not_inside=character" -d "language=en" -d "output_file_name=myoutputfile" -d "output_file_timestamp=true" -d "autoplay=true" -d "autoplay_volume=0.8"`
@@ -754,7 +770,28 @@ 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"}`
-### 🔴 Future to-do list
-- SillyTavern Support
+### 🟠 Example command lines (Streaming Generation)
+Streaming TTS generation does NOT support Narration and will generate an audio stream. Streaming TTS speech JavaScript Example:
+```
+// Example parameters
+const text = "Here is some text";
+const voice = "female_01.wav";
+const language = "en";
+const outputFile = "stream_output.wav";
+// Encode the text for URL
+const encodedText = encodeURIComponent(text);
+// Create the streaming URL
+const streamingUrl = `http://localhost:7851/api/tts-generate-streaming?text=${encodedText}&voice=${voice}&language=${language}&output_file=${outputFile}`;
+// Create and play the audio element
+const audioElement = new Audio(streamingUrl);
+audioElement.play(); // Play the audio stream directly
+```
+- **Text (text):** This is the actual text you want to convert to speech. It should be a string and must be URL-encoded to ensure that special characters (like spaces and punctuation) are correctly transmitted in the URL. Example: `Hello World` becomes `Hello%20World` when URL-encoded.
+- **Voice (voice):** This parameter specifies the voice type to be used for the TTS. The value should match one of the available voice options in AllTalks voices folder. This is a string representing the file, like `female_01.wav`.
+- **Language (language):** This setting determines the language in which the text should be spoken. A two-letter language code (like `en` for English, `fr` for French, etc.).
+- **Output File (output_file):** This parameter names the output file where the audio will be streamed. It should be a string representing the file name, such as `stream_output.wav`. AllTalk will not save this as a file in its outputs folder.
+
+ ### 🔴 Future to-do list
- Possibly add some additional TTS engines (TBD).
+- Tagging support within text.
- Have a break!
From 22de1bf0c6665ec0f227ec5a7de64883e828eda1 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 12:39:39 +0000
Subject: [PATCH 11/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index ac7f619..8767954 100644
--- a/README.md
+++ b/README.md
@@ -790,8 +790,8 @@ audioElement.play(); // Play the audio stream directly
- **Voice (voice):** This parameter specifies the voice type to be used for the TTS. The value should match one of the available voice options in AllTalks voices folder. This is a string representing the file, like `female_01.wav`.
- **Language (language):** This setting determines the language in which the text should be spoken. A two-letter language code (like `en` for English, `fr` for French, etc.).
- **Output File (output_file):** This parameter names the output file where the audio will be streamed. It should be a string representing the file name, such as `stream_output.wav`. AllTalk will not save this as a file in its outputs folder.
-
- ### 🔴 Future to-do list
+
+### 🔴 Future to-do list
- Possibly add some additional TTS engines (TBD).
- Tagging support within text.
- Have a break!
From f0c9e3e6bbebbad4600395d23ea4eedfcd425ca0 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 12:40:20 +0000
Subject: [PATCH 12/61] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 8767954..3f6a155 100644
--- a/README.md
+++ b/README.md
@@ -791,6 +791,7 @@ audioElement.play(); // Play the audio stream directly
- **Language (language):** This setting determines the language in which the text should be spoken. A two-letter language code (like `en` for English, `fr` for French, etc.).
- **Output File (output_file):** This parameter names the output file where the audio will be streamed. It should be a string representing the file name, such as `stream_output.wav`. AllTalk will not save this as a file in its outputs folder.
+
### 🔴 Future to-do list
- Possibly add some additional TTS engines (TBD).
- Tagging support within text.
From 9296843508fa684fabbcf69cb43e3daa0c0d88cc Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 12:48:56 +0000
Subject: [PATCH 13/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 3f6a155..9afa732 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,8 @@ Please check the below link to find a list of all recent updates and changes.
## 🟩 Installation on Text generation web UI
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
-If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
-If you wish to install AllTalk as a standalone application without Text-generation-webui, please go to [this link here](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
+- If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
+- If you wish to install AllTalk as a **standalone application** without Text-generation-webui, please go to [this link here](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
If you are wanting to generate bulk quantites of TTS and have control over them, please see the AllTalk TTS Generator below.
+
If you are wanting to generate bulk quantites of TTS and have control over them,
+ please see the AllTalk TTS Generator below.
`);
+ $('#ttsExtensionMenuItem').attr('title', 'TTS play/pause').on('click', onAudioControlClicked);
+ updateUiAudioPlayState();
+}
+
+function completeCurrentAudioJob() {
+ audioQueueProcessorReady = true;
+ currentAudioJob = null;
+ talkingAnimation(false); //stop lip animation
+ // updateUiPlayState();
+}
+
+/**
+ * Accepts an HTTP response containing audio/mpeg data, and puts the data as a Blob() on the queue for playback
+ * @param {Response} response
+ */
+async function addAudioJob(response) {
+ const audioData = await response.blob();
+ if (!audioData.type.startsWith('audio/')) {
+ throw `TTS received HTTP response with invalid data format. Expecting audio/*, got ${audioData.type}`;
+ }
+ audioJobQueue.push(audioData);
+ console.debug('Pushed audio job to queue.');
+}
+
+async function processAudioJobQueue() {
+ // Nothing to do, audio not completed, or audio paused - stop processing.
+ if (audioJobQueue.length == 0 || !audioQueueProcessorReady || audioPaused) {
+ return;
+ }
+ try {
+ audioQueueProcessorReady = false;
+ currentAudioJob = audioJobQueue.pop();
+ playAudioData(currentAudioJob);
+ talkingAnimation(true);
+ } catch (error) {
+ console.error(error);
+ audioQueueProcessorReady = true;
+ }
+}
+
+//################//
+// TTS Control //
+//################//
+
+let ttsJobQueue = [];
+let currentTtsJob; // Null if nothing is currently being processed
+let currentMessageNumber = 0;
+
+function completeTtsJob() {
+ console.info(`Current TTS job for ${currentTtsJob?.name} completed.`);
+ currentTtsJob = null;
+}
+
+function saveLastValues() {
+ const context = getContext();
+ lastChatId = context.chatId;
+ lastMessageHash = getStringHash(
+ (context.chat.length && context.chat[context.chat.length - 1].mes) ?? '',
+ );
+}
+
+async function tts(text, voiceId, char) {
+ let response = await ttsProvider.generateTts(text, voiceId);
+
+ // RVC injection
+ if (extension_settings.rvc.enabled && typeof window['rvcVoiceConversion'] === 'function')
+ response = await window['rvcVoiceConversion'](response, char, text);
+
+ addAudioJob(response);
+ completeTtsJob();
+}
+
+async function processTtsQueue() {
+ // Called each moduleWorker iteration to pull chat messages from queue
+ if (currentTtsJob || ttsJobQueue.length <= 0 || audioPaused) {
+ return;
+ }
+
+ console.debug('New message found, running TTS');
+ currentTtsJob = ttsJobQueue.shift();
+ let text = extension_settings.tts.narrate_translated_only ? (currentTtsJob?.extra?.display_text || currentTtsJob.mes) : currentTtsJob.mes;
+
+ if (extension_settings.tts.skip_codeblocks) {
+ text = text.replace(/^\s{4}.*$/gm, '').trim();
+ text = text.replace(/```.*?```/gs, '').trim();
+ }
+
+ if (!extension_settings.tts.pass_asterisks) {
+ text = extension_settings.tts.narrate_dialogues_only
+ ? text.replace(/\*[^*]*?(\*|$)/g, '').trim() // remove asterisks content
+ : text.replaceAll('*', '').trim(); // remove just the asterisks
+ }
+
+ if (extension_settings.tts.narrate_quoted_only) {
+ const special_quotes = /[“”]/g; // Extend this regex to include other special quotes
+ text = text.replace(special_quotes, '"');
+ const matches = text.match(/".*?"/g); // Matches text inside double quotes, non-greedily
+ const partJoiner = (ttsProvider?.separator || ' ... ');
+ text = matches ? matches.join(partJoiner) : text;
+ }
+
+ if (typeof ttsProvider?.processText === 'function') {
+ text = await ttsProvider.processText(text);
+ }
+
+ // Collapse newlines and spaces into single space
+ text = text.replace(/\s+/g, ' ').trim();
+
+ console.log(`TTS: ${text}`);
+ const char = currentTtsJob.name;
+
+ // Remove character name from start of the line if power user setting is disabled
+ if (char && !power_user.allow_name2_display) {
+ const escapedChar = escapeRegex(char);
+ text = text.replace(new RegExp(`^${escapedChar}:`, 'gm'), '');
+ }
+
+ try {
+ if (!text) {
+ console.warn('Got empty text in TTS queue job.');
+ completeTtsJob();
+ return;
+ }
+
+ const voiceMapEntry = voiceMap[char] === DEFAULT_VOICE_MARKER ? voiceMap[DEFAULT_VOICE_MARKER] : voiceMap[char];
+
+ if (!voiceMapEntry || voiceMapEntry === DISABLED_VOICE_MARKER) {
+ throw `${char} not in voicemap. Configure character in extension settings voice map`;
+ }
+ const voice = await ttsProvider.getVoice(voiceMapEntry);
+ const voiceId = voice.voice_id;
+ if (voiceId == null) {
+ toastr.error(`Specified voice for ${char} was not found. Check the TTS extension settings.`);
+ throw `Unable to attain voiceId for ${char}`;
+ }
+ tts(text, voiceId, char);
+ } catch (error) {
+ console.error(error);
+ currentTtsJob = null;
+ }
+}
+
+// Secret function for now
+async function playFullConversation() {
+ const context = getContext();
+ const chat = context.chat;
+ ttsJobQueue = chat;
+}
+window.playFullConversation = playFullConversation;
+
+//#############################//
+// Extension UI and Settings //
+//#############################//
+
+function loadSettings() {
+ if (Object.keys(extension_settings.tts).length === 0) {
+ Object.assign(extension_settings.tts, defaultSettings);
+ }
+ for (const key in defaultSettings) {
+ if (!(key in extension_settings.tts)) {
+ extension_settings.tts[key] = defaultSettings[key];
+ }
+ }
+ $('#tts_provider').val(extension_settings.tts.currentProvider);
+ $('#tts_enabled').prop(
+ 'checked',
+ extension_settings.tts.enabled,
+ );
+ $('#tts_narrate_dialogues').prop('checked', extension_settings.tts.narrate_dialogues_only);
+ $('#tts_narrate_quoted').prop('checked', extension_settings.tts.narrate_quoted_only);
+ $('#tts_auto_generation').prop('checked', extension_settings.tts.auto_generation);
+ $('#tts_narrate_translated_only').prop('checked', extension_settings.tts.narrate_translated_only);
+ $('#tts_narrate_user').prop('checked', extension_settings.tts.narrate_user);
+ $('#tts_pass_asterisks').prop('checked', extension_settings.tts.pass_asterisks);
+ $('body').toggleClass('tts', extension_settings.tts.enabled);
+}
+
+const defaultSettings = {
+ voiceMap: '',
+ ttsEnabled: false,
+ currentProvider: 'ElevenLabs',
+ auto_generation: true,
+ narrate_user: false,
+};
+
+function setTtsStatus(status, success) {
+ $('#tts_status').text(status);
+ if (success) {
+ $('#tts_status').removeAttr('style');
+ } else {
+ $('#tts_status').css('color', 'red');
+ }
+}
+
+function onRefreshClick() {
+ Promise.all([
+ ttsProvider.onRefreshClick(),
+ // updateVoiceMap()
+ ]).then(() => {
+ extension_settings.tts[ttsProviderName] = ttsProvider.settings;
+ saveSettingsDebounced();
+ setTtsStatus('Successfully applied settings', true);
+ console.info(`Saved settings ${ttsProviderName} ${JSON.stringify(ttsProvider.settings)}`);
+ initVoiceMap();
+ updateVoiceMap();
+ }).catch(error => {
+ console.error(error);
+ setTtsStatus(error, false);
+ });
+}
+
+function onEnableClick() {
+ extension_settings.tts.enabled = $('#tts_enabled').is(
+ ':checked',
+ );
+ updateUiAudioPlayState();
+ saveSettingsDebounced();
+}
+
+
+function onAutoGenerationClick() {
+ extension_settings.tts.auto_generation = !!$('#tts_auto_generation').prop('checked');
+ saveSettingsDebounced();
+}
+
+
+function onNarrateDialoguesClick() {
+ extension_settings.tts.narrate_dialogues_only = !!$('#tts_narrate_dialogues').prop('checked');
+ saveSettingsDebounced();
+}
+
+function onNarrateUserClick() {
+ extension_settings.tts.narrate_user = !!$('#tts_narrate_user').prop('checked');
+ saveSettingsDebounced();
+}
+
+function onNarrateQuotedClick() {
+ extension_settings.tts.narrate_quoted_only = !!$('#tts_narrate_quoted').prop('checked');
+ saveSettingsDebounced();
+}
+
+
+function onNarrateTranslatedOnlyClick() {
+ extension_settings.tts.narrate_translated_only = !!$('#tts_narrate_translated_only').prop('checked');
+ saveSettingsDebounced();
+}
+
+function onSkipCodeblocksClick() {
+ extension_settings.tts.skip_codeblocks = !!$('#tts_skip_codeblocks').prop('checked');
+ saveSettingsDebounced();
+}
+
+function onPassAsterisksClick() {
+ extension_settings.tts.pass_asterisks = !!$('#tts_pass_asterisks').prop('checked');
+ saveSettingsDebounced();
+}
+
+//##############//
+// TTS Provider //
+//##############//
+
+async function loadTtsProvider(provider) {
+ //Clear the current config and add new config
+ $('#tts_provider_settings').html('');
+
+ if (!provider) {
+ return;
+ }
+
+ // Init provider references
+ extension_settings.tts.currentProvider = provider;
+ ttsProviderName = provider;
+ ttsProvider = new ttsProviders[provider];
+
+ // Init provider settings
+ $('#tts_provider_settings').append(ttsProvider.settingsHtml);
+ if (!(ttsProviderName in extension_settings.tts)) {
+ console.warn(`Provider ${ttsProviderName} not in Extension Settings, initiatilizing provider in settings`);
+ extension_settings.tts[ttsProviderName] = {};
+ }
+ await ttsProvider.loadSettings(extension_settings.tts[ttsProviderName]);
+ await initVoiceMap();
+}
+
+function onTtsProviderChange() {
+ const ttsProviderSelection = $('#tts_provider').val();
+ extension_settings.tts.currentProvider = ttsProviderSelection;
+ loadTtsProvider(ttsProviderSelection);
+}
+
+// Ensure that TTS provider settings are saved to extension settings.
+export function saveTtsProviderSettings() {
+ extension_settings.tts[ttsProviderName] = ttsProvider.settings;
+ updateVoiceMap();
+ saveSettingsDebounced();
+ console.info(`Saved settings ${ttsProviderName} ${JSON.stringify(ttsProvider.settings)}`);
+}
+
+
+//###################//
+// voiceMap Handling //
+//###################//
+
+async function onChatChanged() {
+ await resetTtsPlayback();
+ const voiceMapInit = initVoiceMap();
+ await Promise.race([voiceMapInit, delay(1000)]);
+ ttsLastMessage = null;
+}
+
+async function onChatDeleted() {
+ const context = getContext();
+
+ // update internal references to new last message
+ lastChatId = context.chatId;
+ currentMessageNumber = context.chat.length ? context.chat.length : 0;
+
+ // compare against lastMessageHash. If it's the same, we did not delete the last chat item, so no need to reset tts queue
+ let messageHash = getStringHash((context.chat.length && context.chat[context.chat.length - 1].mes) ?? '');
+ if (messageHash === lastMessageHash) {
+ return;
+ }
+ lastMessageHash = messageHash;
+ ttsLastMessage = (context.chat.length && context.chat[context.chat.length - 1].mes) ?? '';
+
+ // stop any tts playback since message might not exist anymore
+ await resetTtsPlayback();
+}
+
+/**
+ * Get characters in current chat
+ * @param {boolean} unrestricted - If true, will include all characters in voiceMapEntries, even if they are not in the current chat.
+ * @returns {string[]} - Array of character names
+ */
+function getCharacters(unrestricted) {
+ const context = getContext();
+
+ if (unrestricted) {
+ const names = context.characters.map(char => char.name);
+ names.unshift(DEFAULT_VOICE_MARKER);
+ return names;
+ }
+
+ let characters = [];
+ if (context.groupId === null) {
+ // Single char chat
+ characters.push(DEFAULT_VOICE_MARKER);
+ characters.push(context.name1);
+ characters.push(context.name2);
+ } else {
+ // Group chat
+ characters.push(DEFAULT_VOICE_MARKER);
+ characters.push(context.name1);
+ const group = context.groups.find(group => context.groupId == group.id);
+ for (let member of group.members) {
+ // Remove suffix
+ if (member.endsWith('.png')) {
+ member = member.slice(0, -4);
+ }
+ characters.push(member);
+ }
+ }
+ return characters;
+}
+
+function sanitizeId(input) {
+ // Remove any non-alphanumeric characters except underscore (_) and hyphen (-)
+ let sanitized = input.replace(/[^a-zA-Z0-9-_]/g, '');
+
+ // Ensure first character is always a letter
+ if (!/^[a-zA-Z]/.test(sanitized)) {
+ sanitized = 'element_' + sanitized;
+ }
+
+ return sanitized;
+}
+
+function parseVoiceMap(voiceMapString) {
+ let parsedVoiceMap = {};
+ for (const [charName, voiceId] of voiceMapString
+ .split(',')
+ .map(s => s.split(':'))) {
+ if (charName && voiceId) {
+ parsedVoiceMap[charName.trim()] = voiceId.trim();
+ }
+ }
+ return parsedVoiceMap;
+}
+
+
+
+/**
+ * Apply voiceMap based on current voiceMapEntries
+ */
+function updateVoiceMap() {
+ const tempVoiceMap = {};
+ for (const voice of voiceMapEntries) {
+ if (voice.voiceId === null) {
+ continue;
+ }
+ tempVoiceMap[voice.name] = voice.voiceId;
+ }
+ if (Object.keys(tempVoiceMap).length !== 0) {
+ voiceMap = tempVoiceMap;
+ console.log(`Voicemap updated to ${JSON.stringify(voiceMap)}`);
+ }
+ if (!extension_settings.tts[ttsProviderName].voiceMap) {
+ extension_settings.tts[ttsProviderName].voiceMap = {};
+ }
+ Object.assign(extension_settings.tts[ttsProviderName].voiceMap, voiceMap);
+ saveSettingsDebounced();
+}
+
+class VoiceMapEntry {
+ name;
+ voiceId;
+ selectElement;
+ constructor(name, voiceId = DEFAULT_VOICE_MARKER) {
+ this.name = name;
+ this.voiceId = voiceId;
+ this.selectElement = null;
+ }
+
+ addUI(voiceIds) {
+ let sanitizedName = sanitizeId(this.name);
+ let defaultOption = this.name === DEFAULT_VOICE_MARKER ?
+ `` :
+ ``;
+ let template = `
+
+ ${this.name}
+
+
+ `;
+ $('#tts_voicemap_block').append(template);
+
+ // Populate voice ID select list
+ for (const voiceId of voiceIds) {
+ const option = document.createElement('option');
+ option.innerText = voiceId.name;
+ option.value = voiceId.name;
+ $(`#tts_voicemap_char_${sanitizedName}_voice`).append(option);
+ }
+
+ this.selectElement = $(`#tts_voicemap_char_${sanitizedName}_voice`);
+ this.selectElement.on('change', args => this.onSelectChange(args));
+ this.selectElement.val(this.voiceId);
+ }
+
+ onSelectChange(args) {
+ this.voiceId = this.selectElement.find(':selected').val();
+ updateVoiceMap();
+ }
+}
+
+/**
+ * Init voiceMapEntries for character select list.
+ * @param {boolean} unrestricted - If true, will include all characters in voiceMapEntries, even if they are not in the current chat.
+ */
+export async function initVoiceMap(unrestricted = false) {
+ // Gate initialization if not enabled or TTS Provider not ready. Prevents error popups.
+ const enabled = $('#tts_enabled').is(':checked');
+ if (!enabled) {
+ return;
+ }
+
+ // Keep errors inside extension UI rather than toastr. Toastr errors for TTS are annoying.
+ try {
+ await ttsProvider.checkReady();
+ } catch (error) {
+ const message = `TTS Provider not ready. ${error}`;
+ setTtsStatus(message, false);
+ return;
+ }
+
+ setTtsStatus('TTS Provider Loaded', true);
+
+ // Clear existing voiceMap state
+ $('#tts_voicemap_block').empty();
+ voiceMapEntries = [];
+
+ // Get characters in current chat
+ const characters = getCharacters(unrestricted);
+
+ // Get saved voicemap from provider settings, handling new and old representations
+ let voiceMapFromSettings = {};
+ if ('voiceMap' in extension_settings.tts[ttsProviderName]) {
+ // Handle previous representation
+ if (typeof extension_settings.tts[ttsProviderName].voiceMap === 'string') {
+ voiceMapFromSettings = parseVoiceMap(extension_settings.tts[ttsProviderName].voiceMap);
+ // Handle new representation
+ } else if (typeof extension_settings.tts[ttsProviderName].voiceMap === 'object') {
+ voiceMapFromSettings = extension_settings.tts[ttsProviderName].voiceMap;
+ }
+ }
+
+ // Get voiceIds from provider
+ let voiceIdsFromProvider;
+ try {
+ voiceIdsFromProvider = await ttsProvider.fetchTtsVoiceObjects();
+ }
+ catch {
+ toastr.error('TTS Provider failed to return voice ids.');
+ }
+
+ // Build UI using VoiceMapEntry objects
+ for (const character of characters) {
+ if (character === 'SillyTavern System') {
+ continue;
+ }
+ // Check provider settings for voiceIds
+ let voiceId;
+ if (character in voiceMapFromSettings) {
+ voiceId = voiceMapFromSettings[character];
+ } else if (character === DEFAULT_VOICE_MARKER) {
+ voiceId = DISABLED_VOICE_MARKER;
+ } else {
+ voiceId = DEFAULT_VOICE_MARKER;
+ }
+ const voiceMapEntry = new VoiceMapEntry(character, voiceId);
+ voiceMapEntry.addUI(voiceIdsFromProvider);
+ voiceMapEntries.push(voiceMapEntry);
+ }
+ updateVoiceMap();
+}
+
+$(document).ready(function () {
+ function addExtensionControls() {
+ const settingsHtml = `
+
+
+
+ TTS
+
+
+
+
+
+ Select TTS Provider
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `;
+ $('#extensions_settings').append(settingsHtml);
+ $('#tts_refresh').on('click', onRefreshClick);
+ $('#tts_enabled').on('click', onEnableClick);
+ $('#tts_narrate_dialogues').on('click', onNarrateDialoguesClick);
+ $('#tts_narrate_quoted').on('click', onNarrateQuotedClick);
+ $('#tts_narrate_translated_only').on('click', onNarrateTranslatedOnlyClick);
+ $('#tts_skip_codeblocks').on('click', onSkipCodeblocksClick);
+ $('#tts_pass_asterisks').on('click', onPassAsterisksClick);
+ $('#tts_auto_generation').on('click', onAutoGenerationClick);
+ $('#tts_narrate_user').on('click', onNarrateUserClick);
+ $('#tts_voices').on('click', onTtsVoicesClick);
+ for (const provider in ttsProviders) {
+ $('#tts_provider').append($('').val(provider).text(provider));
+ }
+ $('#tts_provider').on('change', onTtsProviderChange);
+ $(document).on('click', '.mes_narrate', onNarrateOneMessage);
+ }
+ addExtensionControls(); // No init dependencies
+ loadSettings(); // Depends on Extension Controls and loadTtsProvider
+ loadTtsProvider(extension_settings.tts.currentProvider); // No dependencies
+ addAudioControl(); // Depends on Extension Controls
+ const wrapper = new ModuleWorkerWrapper(moduleWorker);
+ setInterval(wrapper.update.bind(wrapper), UPDATE_INTERVAL); // Init depends on all the things
+ eventSource.on(event_types.MESSAGE_SWIPED, resetTtsPlayback);
+ eventSource.on(event_types.CHAT_CHANGED, onChatChanged);
+ eventSource.on(event_types.MESSAGE_DELETED, onChatDeleted);
+ eventSource.on(event_types.GROUP_UPDATED, onChatChanged);
+ registerSlashCommand('speak', onNarrateText, ['narrate', 'tts'], '(text) – narrate any text using currently selected character\'s voice. Use voice="Character Name" argument to set other voice from the voice map, example: /speak voice="Donald Duck" Quack!', true, true);
+ document.body.appendChild(audioElement);
+});
From 3230397a822d992fc2fef9b93ae0b2d2fd7ad43d Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 18:07:01 +0000
Subject: [PATCH 16/61] Standalone installer script
---
start_standalone.bat | 140 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 140 insertions(+)
create mode 100644 start_standalone.bat
diff --git a/start_standalone.bat b/start_standalone.bat
new file mode 100644
index 0000000..28d51dd
--- /dev/null
+++ b/start_standalone.bat
@@ -0,0 +1,140 @@
+@echo off
+cd /D "%~dp0"
+
+@rem Check for a previously stored user choice
+if exist "alltalk_settings.txt" (
+ set /p UserWebUIChoice=alltalk_settings.txt
+)
+
+:CheckChoice
+@rem Perform the action based on the environment variable
+if /I "%UserWebUIChoice%"=="y" (
+ echo Make sure you have started Text-generation-webui's Python environment using cmd_windows.bat.
+ echo This step is required every time before starting AllTalk. If you have NOT done this
+ echo you can press Ctrl+C now to exit, then go run cmd_windows.bat
+ echo.
+ echo This script installed DeepSpeed for CUDA 12.1. If you have CUDA 11.8, Ctrl+C now and manually
+ echo Install DeepSpeed and start AllTalk through Text-generation-webui or Python script.py
+ pause > nul
+ goto InstallRequirements
+) else if /I "%UserWebUIChoice%"=="n" (
+ echo Detected standalone installation.
+ goto BeginInstall
+)
+
+echo Invalid choice detected or an error occurred.
+goto end
+
+:BeginInstall
+set PATH=%PATH%;%SystemRoot%\system32
+
+@rem Check if curl is available
+curl --version >nul 2>&1
+if "%ERRORLEVEL%" NEQ "0" (
+ 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.
+ goto end
+)
+echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. && goto end
+
+@rem Check for special characters in installation path
+set "SPCHARMESSAGE=WARNING: Special characters were detected in the installation path! This can cause the installation to fail!"
+echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
+ call :PrintBigMessage %SPCHARMESSAGE%
+)
+set SPCHARMESSAGE=
+
+@rem fix failed install when installing to a separate drive
+set TMP=%cd%\alltalk_environment
+set TEMP=%cd%\alltalk_environment
+
+@rem deactivate existing conda envs as needed to avoid conflicts
+(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul
+
+@rem config
+set INSTALL_DIR=%cd%\alltalk_environment
+set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
+set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
+set MINICONDA_DOWNLOAD_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
+set conda_exists=F
+
+@rem figure out whether git and conda need to be installed
+call "%CONDA_ROOT_PREFIX%\_conda.exe" --version >nul 2>&1
+if "%ERRORLEVEL%" EQU "0" (
+ set conda_exists=T
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
+ goto RunScript
+)
+
+@rem download and install conda if not installed
+echo Downloading Miniconda from %MINICONDA_DOWNLOAD_URL% to %INSTALL_DIR%\miniconda_installer.exe
+mkdir "%INSTALL_DIR%"
+call curl -Lk "%MINICONDA_DOWNLOAD_URL%" > "%INSTALL_DIR%\miniconda_installer.exe" || ( echo. && echo Miniconda failed to download. && goto end )
+echo Installing Miniconda to %CONDA_ROOT_PREFIX%
+start /wait "" "%INSTALL_DIR%\miniconda_installer.exe" /InstallationType=JustMe /NoShortcuts=1 /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%CONDA_ROOT_PREFIX%
+echo Miniconda version:
+call "%CONDA_ROOT_PREFIX%\_conda.exe" --version || ( echo. && echo Miniconda not found. && goto end )
+
+@rem create the installer env
+echo Packages to install: %PACKAGES_TO_INSTALL%
+call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.11 || ( echo. && echo Conda environment creation failed. && goto end )
+
+@rem check if conda environment was actually created
+if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is empty. && goto end )
+
+@rem activate installer env
+call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
+
+:InstallRequirements
+@rem Ask user for the type of requirements to install
+echo Choose the type of requirements to install (this will take 10-20 minutes to install):
+echo.
+echo 1. Nvidia graphics card machines
+echo 2. Other machines (mac, amd, etc)
+echo.
+set /p UserChoice="Enter your choice (1 or 2): "
+
+@rem Install requirements based on user choice
+if "%UserChoice%" == "1" (
+ echo Installing Nvidia requirements...
+ pip install -r requirements_nvidia.txt
+ echo Downloading Pytorch with CUDA..
+ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
+ echo Downloading DeepSpeed...
+ curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
+ echo Installing DeepSpeed...
+ pip install deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
+ del deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
+) else (
+ echo Installing requirements for other machines...
+ pip install -r requirements_other.txt
+)
+
+:RunScript
+@rem setup installer env
+call python script.py %*
+
+@rem below are functions for the script
+goto end
+
+:PrintBigMessage
+echo. && echo.
+echo *******************************************************************
+for %%M in (%*) do echo * %%~M
+echo *******************************************************************
+echo. && echo.
+exit /b
+
+:end
+pause
From e9d9f54de6edda6818da74974a343285c0fb0135 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 18:10:42 +0000
Subject: [PATCH 17/61] Update script.py
---
script.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/script.py b/script.py
index d874aef..13a2c43 100644
--- a/script.py
+++ b/script.py
@@ -237,10 +237,12 @@ process = subprocess.Popen(["python", script_path])
# Check if the subprocess has started successfully
if process.poll() is None:
print(f"[{params['branding']}Startup] TTS Subprocess starting")
+ print(f"[{params['branding']}Startup]")
print(
- f"[{params['branding']}Startup] Readme available here:",
+ f"[{params['branding']}Startup] web interface here:",
f"http://{params['ip_address']}:{params['port_number']}",
)
+ print(f"[{params['branding']}Startup]")
else:
print(
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess Webserver failing to start process"
From d4a04096c894a9bce54f1a346cdd573522a028b8 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Wed, 10 Jan 2024 18:28:55 +0000
Subject: [PATCH 18/61] Made Server address more visible on startup
---
script.py | 131 +++++++++++++++++-------------------------------------
1 file changed, 41 insertions(+), 90 deletions(-)
diff --git a/script.py b/script.py
index 13a2c43..2ee482d 100644
--- a/script.py
+++ b/script.py
@@ -239,7 +239,7 @@ if process.poll() is None:
print(f"[{params['branding']}Startup] TTS Subprocess starting")
print(f"[{params['branding']}Startup]")
print(
- f"[{params['branding']}Startup] web interface here:",
+ f"[{params['branding']}Startup] Settings & Documentation:",
f"http://{params['ip_address']}:{params['port_number']}",
)
print(f"[{params['branding']}Startup]")
@@ -738,93 +738,16 @@ def input_modifier(string, state):
def ui():
with gr.Accordion(params["branding"] + " TTS (XTTSv2)"):
with gr.Row():
- activate = gr.Checkbox(value=params["activate"], label="Activate TTS")
- autoplay = gr.Checkbox(
- value=params["autoplay"], label="Play TTS automatically"
- )
-
+ activate = gr.Checkbox(value=params['activate'], label='Enable TTS')
+ autoplay = gr.Checkbox(value=params['autoplay'], label='Autoplay TTS')
+ show_text = gr.Checkbox(value=params['show_text'], label='Show Text')
+
with gr.Row():
- show_text = gr.Checkbox(
- value=params["show_text"], label="Show message text under audio player"
- )
- remove_trailing_dots = gr.Checkbox(
- value=params["remove_trailing_dots"],
- label='Remove trailing "." from text segments before generation',
- )
-
- with gr.Row():
- with gr.Row():
- available_voices = get_available_voices()
- default_voice = params["voice"]
- # Check if the default voice is in the list of available voices
- if default_voice not in available_voices:
- # Handle the case where the default voice is not in the list (choose a default value or update it)
- default_voice = available_voices[
- 0
- ] # Choose the first available voice as the default
- # Add allow_custom_value=True to the Dropdown
- voice = gr.Dropdown(
- available_voices,
- label="Default Voice",
- value=default_voice,
- allow_custom_value=True,
- )
- create_refresh_button(
- voice,
- lambda: None,
- lambda: {
- "choices": get_available_voices(),
- "value": params["voice"],
- },
- "refresh-button",
- )
-
- language = gr.Dropdown(
- languages.keys(),
- label="Language",
- allow_custom_value=True,
- value=params["language"],
- )
-
- with gr.Row():
- with gr.Row():
- narrator_voice_gr = gr.Dropdown(
- get_available_voices(),
- label="Narrator Voice",
- allow_custom_value=True,
- value=params["narrator_voice"],
- )
- create_refresh_button(
- narrator_voice_gr,
- lambda: None,
- lambda: {
- "choices": get_available_voices(),
- "value": params["narrator_voice"],
- },
- "refresh-button",
- )
- narrator_enabled_gr = gr.Radio(
- choices={"Enabled": "true", "Disabled": "false"},
- label="Narrator Activation",
- value="Enabled" if params.get("narrator_enabled") else "Disabled",
- )
- non_quoted_text_is_gr = gr.Radio(
- choices={"Char": "true", "Narrator": "false"},
- label='Text NOT inside of * or " is',
- value="Char" if non_quoted_text_is else "Narrator",
- )
-
- with gr.Row():
- low_vram = gr.Checkbox(
- value=params["low_vram"], label="Low VRAM mode (Read NOTE)"
- )
+ low_vram = gr.Checkbox(value=params['low_vram'], label='Enable Low VRAM Mode')
low_vram_play = gr.HTML(visible=False)
- deepspeed_checkbox = gr.Checkbox(
- value=params["deepspeed_activate"],
- label="Activate DeepSpeed (Read NOTE)",
- visible=deepspeed_installed,
- )
+ deepspeed_checkbox = gr.Checkbox(value=params['deepspeed_activate'], label='Enable DeepSpeed', visible=deepspeed_installed)
deepspeed_checkbox_play = gr.HTML(visible=False)
+ remove_trailing_dots = gr.Checkbox(value=params['remove_trailing_dots'], label='Remove trailing "."')
with gr.Row():
model_loader_choices=["API TTS", "API Local", "XTTSv2 Local"]
@@ -832,13 +755,37 @@ def ui():
model_loader_choices.append("XTTSv2 FT")
tts_radio_buttons = gr.Radio(
choices=model_loader_choices,
- label="Select TTS Generation Method (Read NOTE)",
+ label="TTS Method (Each method sounds slightly different)",
value=gr_modelchoice, # Set the default value
)
tts_radio_buttons_play = gr.HTML(visible=False)
- explanation_text = gr.HTML(
- f"
⚙️ Click here for the Settings page, help & instructions⚙️ NOTE: Switching Model Type, Low VRAM & DeepSpeed, each takes 15 seconds. Each TTS generation method has a slightly different sound. DeepSpeed checkbox is only visible if DeepSpeed is installed on your system."
- )
+ with gr.Row():
+ available_voices = get_available_voices()
+ default_voice = params["voice"] # Check if the default voice is in the list of available voices
+
+ if default_voice not in available_voices:
+ default_voice = available_voices[ 0 ] # Choose the first available voice as the default
+ # Add allow_custom_value=True to the Dropdown
+ voice = gr.Dropdown(available_voices, label="Character Voice", value=default_voice, allow_custom_value=True, )
+ create_refresh_button(voice, lambda: None, lambda: {"choices": get_available_voices(), "value": params["voice"],}, "refresh-button",)
+
+ with gr.Row():
+ language = gr.Dropdown(languages.keys(), label="Language", value=params["language"])
+ with gr.Row():
+ narrator_voice_gr = gr.Dropdown(get_available_voices(), label="Narrator Voice", allow_custom_value=True, value=params["narrator_voice"])
+ create_refresh_button(narrator_voice_gr, lambda: None, lambda: {"choices": get_available_voices(), "value": params["narrator_voice"],}, "refresh-button")
+
+ # Temperature and Repetition Penalty (Not yet parsed to api/implemented)
+ # with gr.Row():
+ # local_temperature_gr = gr.Slider(minimum=0, maximum=1, step=0.05, label="Temperature", value=params["local_temperature"])
+ # local_repetition_penalty_gr = gr.Slider(minimum=0, maximum=20, step=0.5, label="Repetition Penalty", value=params["local_repetition_penalty"])
+
+ with gr.Row():
+ with gr.Row():
+ narrator_enabled_gr = gr.Radio(choices={"Enabled": "true", "Disabled": "false"}, label="Narrator", value="Enabled" if params.get("narrator_enabled") else "Disabled")
+ non_quoted_text_is_gr = gr.Radio(choices={"Character": "true", "Narrator": "false"}, label='Unmarked text NOT inside of * or " is', value="Character" if non_quoted_text_is else "Narrator")
+ explanation_text = gr.HTML(
+ f"
⚙️ Settings and Documentation Page⚙️ - Low VRAM Mode and Deepspeed take 15 seconds to be enabled or disabled. - The DeepSpeed checkbox is only visible if DeepSpeed is present.
")
with gr.Row():
preview_text = gr.Text(
@@ -917,6 +864,10 @@ def ui():
voice.change(lambda x: params.update({"voice": x}), voice, None)
language.change(lambda x: params.update({"language": x}), language, None)
+ # TS Settings (Not yet parsed to api/implemented)
+ # local_temperature_gr.change(lambda x: params.update({"local_temperature": x}), local_temperature_gr, None)
+ # local_repetition_penalty_gr.change(lambda x: params.update({"local_repetition_penalty": x}), local_repetition_penalty_gr, None)
+
# Narrator selection actions
narrator_enabled_gr.change(update_narrator_enabled, narrator_enabled_gr, None)
non_quoted_text_is_gr.change(update_non_quoted_text_is, non_quoted_text_is_gr, None)
@@ -936,4 +887,4 @@ if running_in_standalone:
try:
time.sleep(1) # Add a small delay to avoid high CPU usage
except KeyboardInterrupt:
- break # Allow graceful exit on Ctrl+C
+ break # Allow graceful exit on Ctrl+C
\ No newline at end of file
From 1f2ad303a0b152669b619cb2757701688efa7631 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Thu, 11 Jan 2024 20:05:16 +0000
Subject: [PATCH 19/61] Corrected ST setting TTS options
---
templates/STfiles/alltalk.js | 56 +++++++++++++++++++++++++++++++-----
1 file changed, 49 insertions(+), 7 deletions(-)
diff --git a/templates/STfiles/alltalk.js b/templates/STfiles/alltalk.js
index 41dc251..0d29c6f 100644
--- a/templates/STfiles/alltalk.js
+++ b/templates/STfiles/alltalk.js
@@ -268,23 +268,56 @@ class AllTalkTtsProvider {
// Apply settings to Narrator Voice dropdown
if (narratorVoiceSelect && this.settings.narrator_voice) {
narratorVoiceSelect.value = this.settings.narrator_voice.replace('.wav', '');
+ this.settings.narrator_voice_gen = this.settings.narrator_voice;
+ //console.log(this.settings.narrator_voice_gen)
}
// Apply settings to AT Narrator Enabled dropdown
if (atNarratorSelect) {
+ //console.log(this.settings.narrator_enabled)
+ // Sync the state with the checkbox in index.js
+ const ttsPassAsterisksCheckbox = document.getElementById('tts_pass_asterisks'); // Access the checkbox from index.js
+ const ttsNarrateQuotedCheckbox = document.getElementById('tts_narrate_quoted'); // Access the checkbox from index.js
+ const ttsNarrateDialoguesCheckbox = document.getElementById('tts_narrate_dialogues'); // Access the checkbox from index.js
+ // Sync the state with the checkbox in index.js
+ if (this.settings.narrator_enabled) {
+ ttsPassAsterisksCheckbox.checked = false;
+ $('#tts_pass_asterisks').click(); // Simulate a click event
+ $('#tts_pass_asterisks').trigger('change');
+ }
+ if (!this.settings.narrator_enabled) {
+ ttsPassAsterisksCheckbox.checked = true;
+ $('#tts_pass_asterisks').click(); // Simulate a click event
+ $('#tts_pass_asterisks').trigger('change');
+ }
+ // Uncheck and set tts_narrate_quoted to false if narrator is enabled
+ if (this.settings.narrator_enabledd) {
+ ttsNarrateQuotedCheckbox.checked = true;
+ ttsNarrateDialoguesCheckbox.checked = true;
+ // Trigger click events instead of change events
+ $('#tts_narrate_quoted').click();
+ $('#tts_narrate_quoted').trigger('change');
+ $('#tts_narrate_dialogues').click();
+ $('#tts_narrate_dialogues').trigger('change');
+ }
atNarratorSelect.value = this.settings.narrator_enabled.toString();
+ this.settings.narrator_enabled = this.settings.narrator_enabled.toString();
}
// Apply settings to the Language dropdown
const languageSelect = document.getElementById('language_options');
if (languageSelect && this.settings.language) {
languageSelect.value = this.settings.language;
+ //console.log(this.settings.language)
}
// Apply settings to Text Not Inside dropdown
if (textNotInsideSelect && this.settings.text_not_inside) {
textNotInsideSelect.value = this.settings.text_not_inside;
+ this.settings.at_narrator_text_not_inside = this.settings.text_not_inside;
+ //console.log(this.settings.at_narrator_text_not_inside)
}
// Apply settings to Generation Method dropdown
if (generationMethodSelect && this.settings.at_generation_method) {
generationMethodSelect.value = this.settings.at_generation_method;
+ //console.log(this.settings.at_generation_method)
}
// Additional logic to disable/enable dropdowns based on the selected generation method
const isStreamingEnabled = this.settings.at_generation_method === 'streaming_enabled';
@@ -595,23 +628,32 @@ class AllTalkTtsProvider {
narratorVoiceSelect.disabled = !isNarratorEnabled;
// Sync the state with the checkbox in index.js
- if (ttsPassAsterisksCheckbox) {
- ttsPassAsterisksCheckbox.checked = isNarratorEnabled;
+ if (isNarratorEnabled) {
+ ttsPassAsterisksCheckbox.checked = false;
+ $('#tts_pass_asterisks').click(); // Simulate a click event
+ $('#tts_pass_asterisks').trigger('change');
+ }
+ if (!isNarratorEnabled) {
+ ttsPassAsterisksCheckbox.checked = true;
+ $('#tts_pass_asterisks').click(); // Simulate a click event
+ $('#tts_pass_asterisks').trigger('change');
}
// Uncheck and set tts_narrate_quoted to false if narrator is enabled
if (isNarratorEnabled) {
- ttsNarrateQuotedCheckbox.checked = false;
- ttsNarrateDialoguesCheckbox.checked = false;
- // Trigger any necessary event handlers or updates for tts_narrate_quoted
+ ttsNarrateQuotedCheckbox.checked = true;
+ ttsNarrateDialoguesCheckbox.checked = true;
+ // Trigger click events instead of change events
+ $('#tts_narrate_quoted').click();
$('#tts_narrate_quoted').trigger('change');
+ $('#tts_narrate_dialogues').click();
$('#tts_narrate_dialogues').trigger('change');
}
-
this.onSettingsChangeAllTalk(); // Save the settings after change
});
}
+
// Event Listener for AT Generation Method Dropdown
const atGenerationMethodSelect = document.getElementById('at_generation_method');
const atNarratorEnabledSelect = document.getElementById('at_narrator_enabled');
@@ -632,7 +674,6 @@ class AllTalkTtsProvider {
this.settings.at_generation_method = selectedMethod; // Update the setting here
this.onSettingsChangeAllTalk(); // Save the settings after change
});
-
}
// Listener for Language Dropdown
@@ -874,6 +915,7 @@ function updateStatus(message) {
function saveAllTalkSettings(settingsToSave) {
// Save the specific settings to localStorage
+ console.log("settings", settingsToSave)
localStorage.setItem('AllTalkSettings', JSON.stringify(settingsToSave));
}
From e54c7e4362e0450bc0d877f477c4f8aaa287bb16 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Thu, 11 Jan 2024 20:13:28 +0000
Subject: [PATCH 20/61] atsetup.bat
first version of a simple setup file.
---
atsetup.bat | 491 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 491 insertions(+)
create mode 100644 atsetup.bat
diff --git a/atsetup.bat b/atsetup.bat
new file mode 100644
index 0000000..fbe2722
--- /dev/null
+++ b/atsetup.bat
@@ -0,0 +1,491 @@
+@echo off
+cd /D "%~dp0"
+
+set PATH=%PATH%;%SystemRoot%\system32
+
+@rem Check if curl is available
+curl --version >nul 2>&1
+if "%ERRORLEVEL%" NEQ "0" (
+ 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.
+ goto end
+)
+
+:MainMenu
+cls
+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.
+set /p UserOption="Enter your choice: "
+
+if "%UserOption%"=="1" goto WebUIMenu
+if "%UserOption%"=="2" goto StandaloneMenu
+if "%UserOption%"=="9" goto End
+goto MainMenu
+
+:WebUIMenu
+cls
+echo.
+echo You have selected Text-generation-webui.
+echo.
+echo Please ensure you have started your Text-generation-webui Python environment. If you have NOT done this,
+echo please run "cmd_windows.bat" in the text-generation-webui folder and then re-run "atsetup.bat"
+echo.
+echo 1) Install the requirements for a Nvidia machine.
+echo 2) Install the requirements for a AMD or MAC machine.
+echo 3) Install the Finetuning requirements.
+echo 4) Install "DeepSpeed v11.2 for CUDA 11.8 & Python 3.11.x".
+echo 5) Install "DeepSpeed v11.2 for CUDA 12.1 & Python 3.11.x".
+echo 6) Uninstall DeepSpeed.
+echo 7) Generate a diagnostics file.
+echo.
+echo 9) Exit/Quit
+echo.
+set /p WebUIOption="Enter your choice: "
+if "%WebUIOption%"=="1" goto InstallNvidiaTextGen
+if "%WebUIOption%"=="2" goto InstallOtherTextGen
+if "%WebUIOption%"=="3" goto InstallFinetuneTextGen
+if "%WebUIOption%"=="4" goto InstallDeepSpeed118TextGen
+if "%WebUIOption%"=="5" goto InstallDeepSpeed121TextGen
+if "%WebUIOption%"=="6" goto UnInstallDeepSpeed
+if "%WebUIOption%"=="7" goto GenerateDiagsTextGen
+if "%WebUIOption%"=="9" goto End
+goto WebUIMenu
+
+:StandaloneMenu
+cls
+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 (You will need to run 1 again after)
+echo 3) Install the Finetuning requirements (You need to have created the AllTalk custom environment)
+echo 4) Generate a diagnostics file (You need to have created the AllTalk custom environment)
+echo.
+echo 9) Exit/Quit
+echo.
+set /p StandaloneOption="Enter your choice: "
+if "%StandaloneOption%"=="1" goto InstallCustomStandalone
+if "%StandaloneOption%"=="2" goto DeleteCustomStandalone
+if "%StandaloneOption%"=="3" goto InstallFinetuneStandalone
+if "%StandaloneOption%"=="4" goto GenerateDiagsStandalone
+if "%StandaloneOption%"=="9" goto End
+goto StandaloneMenu
+
+:InstallNvidiaTextGen
+pip install -r requirements_nvidia.txt
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error installing the Nvidia requirements.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+Echo.
+echo *************************************************************************************
+echo.
+Echo Nvidia machine requirements installed successfully.
+Echo.
+echo *************************************************************************************
+pause
+goto WebUIMenu
+
+:InstallOtherTextGen
+pip install -r requirements_other.txt
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error installing the Other requirements.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+Echo.
+echo *************************************************************************************
+echo.
+Echo Other machine requirements installed successfully.
+Echo.
+echo *************************************************************************************
+pause
+goto WebUIMenu
+
+:InstallFinetuneTextGen
+pip install -r requirements_finetune.txt
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error installing the Finetune requirements.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+Echo.
+Echo ******************************************************************************************************
+Echo.
+Echo Finetune requirements installed successfully. Please ensure you have installed CUDA 11.8 requirements.
+Echo Finetune needs access to cublas64_11.dll and will error if this is not setup correctly.
+Echo Please see here for details https://github.com/erew123/alltalk_tts#-finetuning-a-model
+Echo.
+Echo ******************************************************************************************************
+pause
+goto WebUIMenu
+
+:InstallDeepSpeed118TextGen
+echo Downloading DeepSpeed...
+curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Failed to download DeepSpeed wheel file.
+ echo Please check your internet connection or try again later.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+echo DeepSpeed wheel file downloaded successfully.
+echo Installing DeepSpeed...
+pip install deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Failed to install DeepSpeed.
+ echo Please check if the wheel file is compatible with your system.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+Echo.
+echo *************************************************************************************
+echo.
+Echo DeepSpeed installed successfully.
+Echo.
+echo *************************************************************************************
+del deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
+pause
+goto WebUIMenu
+
+:InstallDeepSpeed121TextGen
+echo Downloading DeepSpeed...
+curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Failed to download DeepSpeed wheel file.
+ echo Please check your internet connection or try again later.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+echo DeepSpeed wheel file downloaded successfully.
+echo Installing DeepSpeed...
+pip install deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Failed to install DeepSpeed.
+ echo Please check if the wheel file is compatible with your system.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+Echo.
+echo *************************************************************************************
+echo.
+Echo DeepSpeed installed successfully.
+Echo.
+echo *************************************************************************************
+del deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
+pause
+goto WebUIMenu
+
+:UnInstallDeepSpeed
+pip uninstall deepspeed
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error uninstalling DeepSpeed.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto WebUIMenu
+)
+echo *************************************************************************************
+echo.
+Echo DeepSpeed uninstalled successfully.
+Echo.
+echo *************************************************************************************
+pause
+goto WebUIMenu
+
+:GenerateDiagsTextGen
+Python diagnostics.py
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error running diagnostics. Have you correctly started your
+ echo Text-generation-webui Python environment with "cmd_windows.bat"?
+ pause
+ goto WebUIMenu
+)
+Echo.
+echo *************************************************************************************
+echo.
+Echo Diagnostics.log generated. Please scroll up to look over the log.
+Echo.
+echo *************************************************************************************
+pause
+goto WebUIMenu
+
+:InstallCustomStandalone
+set PATH=%PATH%;%SystemRoot%\system32
+
+@rem Check if curl is available
+curl --version >nul 2>&1
+if "%ERRORLEVEL%" NEQ "0" (
+ 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.
+ goto end
+)
+echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. Please correct your folder names and re-try installation. && goto exit
+
+@rem Check for special characters in installation path
+set "SPCHARMESSAGE=WARNING: Special characters were detected in the installation path! This can cause the installation to fail!"
+echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
+ call :PrintBigMessage %SPCHARMESSAGE%
+)
+set SPCHARMESSAGE=
+
+@rem fix failed install when installing to a separate drive
+set TMP=%cd%\alltalk_environment
+set TEMP=%cd%\alltalk_environment
+
+@rem deactivate existing conda envs as needed to avoid conflicts
+(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul
+
+@rem config
+set INSTALL_DIR=%cd%\alltalk_environment
+set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
+set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
+set MINICONDA_DOWNLOAD_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
+set conda_exists=F
+
+@rem figure out whether git and conda need to be installed
+call "%CONDA_ROOT_PREFIX%\_conda.exe" --version >nul 2>&1
+if "%ERRORLEVEL%" EQU "0" (
+ set conda_exists=T
+ call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
+ goto RunScript
+)
+
+@rem download and install conda if not installed
+echo Downloading Miniconda from %MINICONDA_DOWNLOAD_URL% to %INSTALL_DIR%\miniconda_installer.exe
+mkdir "%INSTALL_DIR%"
+call curl -Lk "%MINICONDA_DOWNLOAD_URL%" > "%INSTALL_DIR%\miniconda_installer.exe" || ( echo. && echo Miniconda failed to download. && goto end )
+echo Installing Miniconda to %CONDA_ROOT_PREFIX%
+start /wait "" "%INSTALL_DIR%\miniconda_installer.exe" /InstallationType=JustMe /NoShortcuts=1 /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%CONDA_ROOT_PREFIX%
+echo Miniconda version:
+call "%CONDA_ROOT_PREFIX%\_conda.exe" --version || ( echo. && echo Miniconda not found. && goto end )
+
+@rem create the installer env
+echo Packages to install: %PACKAGES_TO_INSTALL%
+call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.11 || ( echo. && echo Conda environment creation failed. && goto end )
+
+@rem check if conda environment was actually created
+if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is empty. && goto end )
+
+@rem activate installer env
+call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
+
+@rem Ask user for the type of requirements to install
+echo *************************************************************************************
+echo.
+echo Choose the type of requirements to install (this will take 10-20 minutes to install):
+echo.
+echo 1. Nvidia graphics card machines
+echo 2. Other machines (mac, amd, etc)
+echo.
+echo *************************************************************************************
+set /p UserChoice="Enter your choice (1 or 2): "
+
+@rem Install requirements based on user choice
+if "%UserChoice%" == "1" (
+ echo.
+ echo Installing Nvidia requirements...
+ echo Downloading Pytorch with CUDA..
+ 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
+ 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...
+ pip install deepspeed-0.12.7+d058d4b-cp311-cp311-win_amd64.whl
+ del deepspeed-0.12.7+d058d4b-cp311-cp311-win_amd64.whl
+) else (
+ echo Installing requirements for other machines...
+ pip install -r requirements_other.txt
+)
+
+@rem Create start_alltalk.bat to run AllTalk
+echo @echo off > start_alltalk.bat
+echo cd /D "%~dp0" >> start_alltalk.bat
+echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_alltalk.bat
+echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_alltalk.bat
+echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_alltalk.bat
+echo call python script.py >> start_alltalk.bat
+echo exit >> start_alltalk.bat
+Echo.
+Echo *************************************************************************************
+Echo.
+Echo "start_alltalk.bat" has been created.
+Echo.
+Echo You can now start AllTalk with "start_alltalk.bat"
+Echo.
+Echo *************************************************************************************
+Echo.
+pause
+goto StandaloneMenu
+
+:DeleteCustomStandalone
+@rem Check if the alltalk_environment directory exists
+if not exist "%cd%\alltalk_environment\" (
+ echo.
+ echo "alltalk_environment" directory does not exist. No need to delete.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+@rem Check if a Conda environment is active
+if not defined CONDA_PREFIX goto NoCondaEnvDeleteCustomStandalone
+@rem Deactivate Conda environment if it's active
+Echo Exiting the Conda Environment. Please run "atsetup.bat" again and delete the environment.
+conda deactivate
+:NoCondaEnvDeleteCustomStandalone
+echo Deleting "alltalk_environment". Please wait.
+rd /s /q "alltalk_environment"
+del start_alltalk.bat
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo Failed to delete "alltalk_environment" folder.
+ echo Please make sure it is not in use and try again.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+echo.
+Echo *************************************************************************************
+Echo.
+echo Environment "alltalk_environment" deleted. Please set up the environment again.
+Echo.
+Echo *************************************************************************************
+pause
+goto StandaloneMenu
+
+:InstallFinetuneStandalone
+cd /D "%~dp0"
+set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
+set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
+@rem Check if the Conda environment exists
+if not exist "%INSTALL_ENV_DIR%\python.exe" (
+ echo.
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
+ echo Please install the environment before proceeding.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+@rem Attempt to activate the Conda environment
+call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
+if errorlevel 1 (
+ echo.
+ echo Failed to activate the Conda environment.
+ echo Please check your installation and try again.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+@rem Proceed with installing requirements
+pip install -r requirements_finetune.txt
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error installing the Finetune requirements.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+Echo.
+Echo ******************************************************************************************************
+Echo.
+Echo Finetune requirements installed successfully. Please ensure you have installed CUDA 11.8 requirements.
+Echo Finetune needs access to cublas64_11.dll and will error if this is not setup correctly.
+Echo Please see here for details https://github.com/erew123/alltalk_tts#-finetuning-a-model
+Echo.
+Echo ******************************************************************************************************
+pause
+goto StandaloneMenu
+
+:GenerateDiagsStandalone
+cd /D "%~dp0"
+set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
+set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
+@rem Check if the Conda environment exists
+if not exist "%INSTALL_ENV_DIR%\python.exe" (
+ echo.
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
+ echo Please install the environment before proceeding.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+@rem Attempt to activate the Conda environment
+call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
+if errorlevel 1 (
+ echo.
+ echo Failed to activate the Conda environment.
+ echo Please check your installation and try again.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+@rem Run diagnostics
+Python diagnostics.py
+if %ERRORLEVEL% neq 0 (
+ echo.
+ echo There was an error running diagnostics.
+ echo Press any key to return to the menu.
+ echo.
+ pause
+ goto StandaloneMenu
+)
+Echo.
+Echo *************************************************************************************
+Echo.
+Echo Diagnostics.log generated. Please scroll up to look over the log.
+Echo.
+Echo *************************************************************************************
+pause
+goto StandaloneMenu
+
+:End
+echo Exiting AllTalk Setup Utility...
+exit /b
From a85058a3ac49597d9a28cd9a46ac1d587aff0942 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Thu, 11 Jan 2024 20:47:13 +0000
Subject: [PATCH 21/61] updated diagnostics
---
diagnostics.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/diagnostics.py b/diagnostics.py
index ca5466a..eca4ad4 100644
--- a/diagnostics.py
+++ b/diagnostics.py
@@ -215,6 +215,13 @@ def log_system_info():
# Print colored output
print(f"{package_name.ljust(max_package_length)} Required: {color_required}{operator} {required_version.ljust(12)}\033[0m Installed: {color_installed}{installed_version}\033[0m")
+
+ print("\nOn Nvidia Graphics cards machines, if your \033[92mInstalled\033[0m version of \033[92mTorch\033[0m and \033[92mTorchaudio\033[0m does")
+ print("not have \033[92m+cu118\033[0m (Cuda 11.8) or \033[92m+cu121\033[0m (Cuda 12.1) listed after them, you do not have CUDA")
+ print("installed for Torch or Torchaudio in this Python environment. This will cause you problems")
+ print("with \033[94mAllTalk\033[0m and \033[94mFinetuning.\033[0m You may have to 'pip install' a new version of torch and")
+ print("torchaudio, using '\033[94m--upgrade --force-reinstall\033[0m' with the correct version of PyTorch for\033[0m")
+ print("your Python environment.\033[0m")
print("\033[94m\nRequirements file specifier meanings:\033[0m")
explanation = textwrap.dedent("""
== Exact version != Any version except < Less than
From 510894c79326398d6379f4377446e1784671a267 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Thu, 11 Jan 2024 22:21:06 +0000
Subject: [PATCH 22/61] Delete start_standalone.bat
---
start_standalone.bat | 140 -------------------------------------------
1 file changed, 140 deletions(-)
delete mode 100644 start_standalone.bat
diff --git a/start_standalone.bat b/start_standalone.bat
deleted file mode 100644
index 28d51dd..0000000
--- a/start_standalone.bat
+++ /dev/null
@@ -1,140 +0,0 @@
-@echo off
-cd /D "%~dp0"
-
-@rem Check for a previously stored user choice
-if exist "alltalk_settings.txt" (
- set /p UserWebUIChoice=alltalk_settings.txt
-)
-
-:CheckChoice
-@rem Perform the action based on the environment variable
-if /I "%UserWebUIChoice%"=="y" (
- echo Make sure you have started Text-generation-webui's Python environment using cmd_windows.bat.
- echo This step is required every time before starting AllTalk. If you have NOT done this
- echo you can press Ctrl+C now to exit, then go run cmd_windows.bat
- echo.
- echo This script installed DeepSpeed for CUDA 12.1. If you have CUDA 11.8, Ctrl+C now and manually
- echo Install DeepSpeed and start AllTalk through Text-generation-webui or Python script.py
- pause > nul
- goto InstallRequirements
-) else if /I "%UserWebUIChoice%"=="n" (
- echo Detected standalone installation.
- goto BeginInstall
-)
-
-echo Invalid choice detected or an error occurred.
-goto end
-
-:BeginInstall
-set PATH=%PATH%;%SystemRoot%\system32
-
-@rem Check if curl is available
-curl --version >nul 2>&1
-if "%ERRORLEVEL%" NEQ "0" (
- 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.
- goto end
-)
-echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. && goto end
-
-@rem Check for special characters in installation path
-set "SPCHARMESSAGE=WARNING: Special characters were detected in the installation path! This can cause the installation to fail!"
-echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
- call :PrintBigMessage %SPCHARMESSAGE%
-)
-set SPCHARMESSAGE=
-
-@rem fix failed install when installing to a separate drive
-set TMP=%cd%\alltalk_environment
-set TEMP=%cd%\alltalk_environment
-
-@rem deactivate existing conda envs as needed to avoid conflicts
-(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul
-
-@rem config
-set INSTALL_DIR=%cd%\alltalk_environment
-set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
-set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
-set MINICONDA_DOWNLOAD_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_23.3.1-0-Windows-x86_64.exe
-set conda_exists=F
-
-@rem figure out whether git and conda need to be installed
-call "%CONDA_ROOT_PREFIX%\_conda.exe" --version >nul 2>&1
-if "%ERRORLEVEL%" EQU "0" (
- set conda_exists=T
- call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
- goto RunScript
-)
-
-@rem download and install conda if not installed
-echo Downloading Miniconda from %MINICONDA_DOWNLOAD_URL% to %INSTALL_DIR%\miniconda_installer.exe
-mkdir "%INSTALL_DIR%"
-call curl -Lk "%MINICONDA_DOWNLOAD_URL%" > "%INSTALL_DIR%\miniconda_installer.exe" || ( echo. && echo Miniconda failed to download. && goto end )
-echo Installing Miniconda to %CONDA_ROOT_PREFIX%
-start /wait "" "%INSTALL_DIR%\miniconda_installer.exe" /InstallationType=JustMe /NoShortcuts=1 /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%CONDA_ROOT_PREFIX%
-echo Miniconda version:
-call "%CONDA_ROOT_PREFIX%\_conda.exe" --version || ( echo. && echo Miniconda not found. && goto end )
-
-@rem create the installer env
-echo Packages to install: %PACKAGES_TO_INSTALL%
-call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.11 || ( echo. && echo Conda environment creation failed. && goto end )
-
-@rem check if conda environment was actually created
-if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is empty. && goto end )
-
-@rem activate installer env
-call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
-
-:InstallRequirements
-@rem Ask user for the type of requirements to install
-echo Choose the type of requirements to install (this will take 10-20 minutes to install):
-echo.
-echo 1. Nvidia graphics card machines
-echo 2. Other machines (mac, amd, etc)
-echo.
-set /p UserChoice="Enter your choice (1 or 2): "
-
-@rem Install requirements based on user choice
-if "%UserChoice%" == "1" (
- echo Installing Nvidia requirements...
- pip install -r requirements_nvidia.txt
- echo Downloading Pytorch with CUDA..
- pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
- echo Downloading DeepSpeed...
- curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
- echo Installing DeepSpeed...
- pip install deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
- del deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
-) else (
- echo Installing requirements for other machines...
- pip install -r requirements_other.txt
-)
-
-:RunScript
-@rem setup installer env
-call python script.py %*
-
-@rem below are functions for the script
-goto end
-
-:PrintBigMessage
-echo. && echo.
-echo *******************************************************************
-for %%M in (%*) do echo * %%~M
-echo *******************************************************************
-echo. && echo.
-exit /b
-
-:end
-pause
From 257fa59e70d8dec3ea382cd4932e6544edd76ae1 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Thu, 11 Jan 2024 23:26:59 +0000
Subject: [PATCH 23/61] Linux atstart script
---
atstart.sh | 381 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 381 insertions(+)
create mode 100644 atstart.sh
diff --git a/atstart.sh b/atstart.sh
new file mode 100644
index 0000000..6785cf4
--- /dev/null
+++ b/atstart.sh
@@ -0,0 +1,381 @@
+#!/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 51a8e93df7879c7b847515e18270f3be072aaa73 Mon Sep 17 00:00:00 2001
From: "q5sys (JT)"
Date: Thu, 11 Jan 2024 21:21:30 -0500
Subject: [PATCH 24/61] Update README.md
Add specific section for deepspeed installation on linux for standalone app.
Related to https://github.com/erew123/alltalk_tts/issues/62
---
README.md | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 72baa97..1c011a9 100644
--- a/README.md
+++ b/README.md
@@ -361,6 +361,8 @@ If you've compacted and moved your model, its highly unlikely you would want to
➡️DeepSpeed requires an Nvidia Graphics card!⬅️
+- #### DeepSpeed Installation for Text generation webUI
+
1) Preferably use your built in package manager to install CUDA tools. Alternatively download and install the Nvidia Cuda Toolkit for Linux [Nvidia Cuda Toolkit 11.8 or 12.1](https://developer.nvidia.com/cuda-toolkit-archive)
2) Open a terminal console.
3) Install libaio-dev (however your Linux version installs things) e.g. `sudo apt install libaio-dev`
@@ -372,13 +374,32 @@ If you've compacted and moved your model, its highly unlikely you would want to
`export CUDA_HOME=/etc/alternatives/cuda`
**every** time you run `./cmd_linux.sh`.
If you try to start DeepSpeed with the CUDA_HOME path set incorrectly, expect an error similar to `[Errno 2] No such file or directory: /home/yourname/text-generation-webui/installer_files/env/bin/nvcc`
-9) Now install deepspeed with pip install deepspeed
-10) You can now start Text generation webUI `python server.py` ensuring to activate your extensions.
+8) Now install deepspeed with pip install deepspeed
+9) You can now start Text generation webUI `python server.py` ensuring to activate your extensions.
Just to reiterate, starting Text-generation-webUI with `./start_linux.sh` will overwrite the CUDA_HOME variable unless you have permanently changed it, hence always starting it with `./cmd_linux.sh` **then** setting the environment variable manually (step 7) and **then** `python server.py`, which is how you would need to run it each time, unless you permanently set the environment variable for CUDA_HOME within Text-generation-webUI's standard Python environment.
**Removal** - If it became necessary to uninstall DeepSpeed, you can do so with `./cmd_linux.sh` and then `pip uninstall deepspeed`
+
+- #### DeepSpeed Installation for standalone alltalk_tts app
+
+1) Preferably use your built in package manager to install CUDA tools. Alternatively download and install the Nvidia Cuda Toolkit for Linux [Nvidia Cuda Toolkit 11.8 or 12.1](https://developer.nvidia.com/cuda-toolkit-archive)
+2) Open a terminal console.
+3) Install libaio-dev (however your Linux version installs things) e.g. `sudo apt install libaio-dev` If you are using an RPM based distribution the package will probably be named `libaio-devel`.
+4) Navigate to your alltalk_tts folder e.g. `cd alltext_tts`
+5) Start the alltalk_tts Python environment `conda activate alltalkenv`
+6) You will need to set the **CUDA_HOME** environment variable. Details to change it each time are on the next step. Below is a link to Conda's manual and changing environment variables permanently though its possible changing it permanently could affect other extensions, you would have to test.
+7) Set the environment path for CUDA_HOME e.g. `export CUDA_HOME=/usr/local/cuda-12.1/bin` or `export CUDA_HOME=/etc/alternative/cuda`. Verify the path on your Linux distro before setting this variable.
+If you try to start DeepSpeed with the CUDA_HOME path set incorrectly, expect an error similar to `[Errno 2] No such file or directory` or `CUDA_HOME does not exist`
+If you set the `env` variable and you receive an error of `[Errno 2] No such file or directory: '/usr/local/cuda-12.1/bin/bin/nvcc'` with a double `bin/bin` path, you can remove the env variable with `unset CUDA_HOME` and add the path to your linux PATH env variable with: `export PATH=$PATH:/usr/local/cuda-12.1/bin`. (Verify the path on your Linux distro before setting this variable.) However if you are using other applications that use CUDA, you will want to verify that configuring the path did not break those applications.
+8) Now install deepspeed with `pip install deepspeed`
+9) You can now start the alltalk_tts webUI with `python script.py`
+
+**Removal** - If it became necessary to uninstall DeepSpeed, you can do so by entering your `alltalkenv` enviroment `conda activate alltalkenv` and then running `pip uninstall deepspeed`
+
+
-
+
#### 🟢🟡 Windows Installation
DeepSpeed v11.2 will work on the current default text-generation-webui Python 3.11 environment! You have 2x options for how to setup DeepSpeed on Windows. A quick way (🟢Option 1) and a long way (🟡Option 2).
From 697fb098c3912578a8cd87edec5a4559c98c16ce Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 09:56:05 +0000
Subject: [PATCH 25/61] Rename atstart.sh to atsetup.sh
---
atstart.sh => atsetup.sh | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename atstart.sh => atsetup.sh (100%)
diff --git a/atstart.sh b/atsetup.sh
similarity index 100%
rename from atstart.sh
rename to atsetup.sh
From 36bfb17edaaa6c9b04e929118cd2946a6fad9650 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 11:30:12 +0000
Subject: [PATCH 26/61] Updated atsetup.sh
---
atsetup.sh | 218 +++++++++++++++++++++++++++++++----------------------
1 file changed, 129 insertions(+), 89 deletions(-)
diff --git a/atsetup.sh b/atsetup.sh
index 6785cf4..5712b1c 100644
--- a/atsetup.sh
+++ b/atsetup.sh
@@ -1,9 +1,19 @@
#!/bin/bash
# ANSI color codes
-RED='\033[1;34m'
+RED='\033[1;31m'
GREEN='\033[1;32m'
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
# Navigate to the script's directory
@@ -23,16 +33,15 @@ main_menu() {
while true; do
clear
echo
- echo "Welcome to the AllTalk Setup Utility"
+ echo -e " ${L_BLUE}ALLTALK LINUX SETUP UTILITY${NC}"
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 " 1) I am using AllTalk as part of Text-generation-webui"
- echo " 2) I am using AllTalk as a Standalone Application"
+ echo -e " 9)${L_RED} Exit/Quit${NC}"
echo
- echo " 9) Exit/Quit"
- echo
- read -p "Enter your choice: " user_option
+ read -p " Enter your choice: " user_option
case $user_option in
1) webui_menu ;;
@@ -48,21 +57,27 @@ webui_menu() {
while true; do
clear
echo
- echo "You have selected Text-generation-webui."
+ echo -e " ${L_BLUE}TEXT-GENERATION-WEBUI SETUP${NC}"
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 -e " Please ensure you have started your Text-generation-webui Python"
+ 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 " 1) Install the requirements for a Nvidia machine."
- echo " 2) Install the requirements for an AMD or MAC machine."
+ echo " BASE REQUIREMENTS"
+ 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 " 4) Install DeepSpeed."
echo " 5) Uninstall DeepSpeed."
+ echo
+ echo " OTHER"
echo " 6) Generate a diagnostics file."
echo
- echo " 9) Back to Main Menu"
+ echo -e " 9)${L_RED} Exit/Quit${NC}"
echo
- read -p "Enter your choice: " webui_option
+ read -p " Enter your choice: " webui_option
case $webui_option in
1) install_nvidia_textgen ;;
@@ -71,7 +86,7 @@ webui_menu() {
4) install_deepspeed ;;
5) uninstall_deepspeed ;;
6) generate_diagnostics_textgen ;;
- 9) break ;;
+ 9) exit 0 ;;
*) echo "Invalid option"; sleep 2 ;;
esac
done
@@ -79,76 +94,90 @@ webui_menu() {
install_nvidia_textgen() {
local requirements_file="requirements_nvidia.txt"
- echo "Installing Finetune requirements from $requirements_file..."
+ 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 " 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 " 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..."
+ 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 " 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 " 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..."
+ 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 " 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
+ 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
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 -e " ${L_BLUE}DEEPSPEED INSTALLATION REQUIREMENTS${NC}"
echo
- read -p "Have you completed all the above steps? (y/n): " confirm
+ 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 " - 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
+ 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}"
+ echo -e " ${RED}DeepSpeed installation cannot proceed without completing the prerequisites.${NC}"
return
fi
- echo -e "\n${GREEN}Proceeding with DeepSpeed installation...${NC}"
+ 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}"
+ 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 -e " ${GREEN}DeepSpeed installed successfully.${NC}"
+ read -p " Press any key to continue. " -n 1
echo
}
@@ -156,27 +185,27 @@ 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."
+ 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."
+ 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 " 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 " Diagnostics completed successfully."
+ read -p " Press any key to continue. " -n 1
echo
}
@@ -185,17 +214,22 @@ standalone_menu() {
while true; do
clear
echo
- echo "You have selected Standalone Application Setup."
+ echo -e " ${L_BLUE}ALLTALK STANDALONE APPLICATION SETUP${NC}"
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 " 3) Install the Finetuning requirements"
echo " 4) Install DeepSpeed."
+ echo
+ echo " OTHER"
echo " 5) Generate a diagnostics file"
echo
- echo " 9) Back to Main Menu"
+ echo -e " 9)${L_RED} Exit/Quit${NC}"
echo
- read -p "Enter your choice: " standalone_option
+ read -p " Enter your choice: " standalone_option
case $standalone_option in
1) install_custom_standalone ;;
@@ -203,7 +237,7 @@ standalone_menu() {
3) install_finetune_standalone ;;
4) install_deepspeed ;;
5) generate_diagnostics_standalone ;;
- 9) break ;;
+ 9) exit 0 ;;
*) echo "Invalid option"; sleep 2 ;;
esac
done
@@ -252,12 +286,12 @@ install_custom_standalone() {
conda activate "${INSTALL_ENV_DIR}"
echo
- echo "Choose the type of requirements to install:"
+ echo -e " ${L_BLUE}Choose the type of requirements to install${NC}"
echo
- echo " 1. Nvidia graphics card machines"
- echo " 2. Other machines (mac, amd, etc)"
+ echo " 1. Nvidia graphics card machines"
+ echo " 2. Other machines (mac, amd, etc)"
echo
- read -p "Enter your choice (1 or 2): " user_choice
+ 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
@@ -291,10 +325,10 @@ 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 -e " start_alltalk.sh has been created."
+ echo -e " You can now start AllTalk with ${L_YELLOW}./start_alltalk.sh${NC}"
echo
- read -p "Press any key to continue. " -n 1
+ read -p " Press any key to continue. " -n 1
}
@@ -302,25 +336,25 @@ 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 " \"$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"
+ 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."
+ 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."
+ echo " Environment \"$env_dir\" deleted successfully."
fi
- read -p "Press any key to continue. " -n 1
+ read -p " Press any key to continue. " -n 1
echo
}
@@ -329,9 +363,9 @@ install_finetune_standalone() {
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 " 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
@@ -340,39 +374,45 @@ install_finetune_standalone() {
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 " 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
+ 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
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 " 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 " 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 " Diagnostics completed successfully."
+ read -p " Press any key to continue. " -n 1
echo
}
From 4a116e359a9901e0102926221ebe29d5e7caaaec Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 12:21:07 +0000
Subject: [PATCH 27/61] updated atsetup.bat
---
atsetup.bat | 228 ++++++++++++++++++++++++++--------------------------
1 file changed, 116 insertions(+), 112 deletions(-)
diff --git a/atsetup.bat b/atsetup.bat
index fbe2722..387dc70 100644
--- a/atsetup.bat
+++ b/atsetup.bat
@@ -3,6 +3,28 @@ cd /D "%~dp0"
set PATH=%PATH%;%SystemRoot%\system32
+:: Generate the ESC character
+for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
+
+:: Standard Colors
+set "BLACK=%ESC%[30m"
+set "RED=%ESC%[31m"
+set "GREEN=%ESC%[32m"
+set "YELLOW=%ESC%[33m"
+set "BLUE=%ESC%[34m"
+set "MAGENTA=%ESC%[35m"
+set "CYAN=%ESC%[36m"
+set "WHITE=%ESC%[37m"
+set "L_BLACK=%ESC%[90m"
+set "L_RED=%ESC%[91m"
+set "L_GREEN=%ESC%[92m"
+set "L_YELLOW=%ESC%[93m"
+set "L_BLUE=%ESC%[94m"
+set "L_MAGENTA=%ESC%[95m"
+set "L_CYAN=%ESC%[96m"
+set "L_WHITE=%ESC%[97m"
+set "RESET=%ESC%[0m"
+
@rem Check if curl is available
curl --version >nul 2>&1
if "%ERRORLEVEL%" NEQ "0" (
@@ -14,16 +36,15 @@ if "%ERRORLEVEL%" NEQ "0" (
:MainMenu
cls
echo.
-echo Welcome to the AllTalk Setup Utility
+echo %L_BLUE%ALLTALK WINDOWS SETUP UTILITY%RESET%
echo.
-echo Please select an option:
+echo INSTALLATION TYPE
+echo 1) I am using AllTalk as part of %L_GREEN%Text-generation-webui%RESET%
+echo 2) I am using AllTalk as a %L_GREEN%Standalone Application%RESET%
echo.
-echo 1) I am using AllTalk as part of Text-generation-webui
-echo 2) I am using AllTalk as a Standalone Application
+echo 9) %L_RED%Exit/Quit%RESET%
echo.
-echo 9) Exit/Quit
-echo.
-set /p UserOption="Enter your choice: "
+set /p UserOption=" Enter your choice: "
if "%UserOption%"=="1" goto WebUIMenu
if "%UserOption%"=="2" goto StandaloneMenu
@@ -33,20 +54,26 @@ goto MainMenu
:WebUIMenu
cls
echo.
-echo You have selected Text-generation-webui.
+echo %L_BLUE%TEXT-GENERATION-WEBUI SETUP%RESET%
echo.
-echo Please ensure you have started your Text-generation-webui Python environment. If you have NOT done this,
-echo please run "cmd_windows.bat" in the text-generation-webui folder and then re-run "atsetup.bat"
+echo Please ensure you have started your Text-generation-webui Python
+echo environment. If you have NOT done this, please run %L_GREEN%cmd_windows.bat%RESET%
+echo in the %L_GREEN%text-generation-webui%RESET% folder and then re-run this script.
echo.
-echo 1) Install the requirements for a Nvidia machine.
-echo 2) Install the requirements for a AMD or MAC machine.
-echo 3) Install the Finetuning requirements.
-echo 4) Install "DeepSpeed v11.2 for CUDA 11.8 & Python 3.11.x".
-echo 5) Install "DeepSpeed v11.2 for CUDA 12.1 & Python 3.11.x".
-echo 6) Uninstall DeepSpeed.
-echo 7) Generate a diagnostics file.
+echo BASE REQUIREMENTS
+echo 1) Install the requirements for a %L_GREEN%Nvidia machine%RESET%.
+echo 2) Install the requirements for a %L_GREEN%AMD or MAC machine%RESET%.
echo.
-echo 9) Exit/Quit
+echo OPTIONAL
+echo 3) Install the Finetuning requirements.
+echo 4) Install DeepSpeed v11.2 for CUDA %L_GREEN%11.8%RESET% and Python-3.11.x.
+echo 5) Install DeepSpeed v11.2 for CUDA %L_GREEN%12.1%RESET% and Python-3.11.x.
+echo 6) Uninstall DeepSpeed.
+echo.
+echo. OTHER
+echo 7) Generate a diagnostics file.
+echo.
+echo 9) %L_RED%Exit/Quit%RESET%
echo.
set /p WebUIOption="Enter your choice: "
if "%WebUIOption%"=="1" goto InstallNvidiaTextGen
@@ -62,14 +89,19 @@ goto WebUIMenu
:StandaloneMenu
cls
echo.
-echo You have selected Standalone Application Setup.
+echo %L_BLUE%ALLTALK STANDALONE APPLICATION SETUP%RESET%
echo.
-echo 1) Install AllTalk's custom Python environment (Setup AllTalk as a standalone Application)
-echo 2) Delete AllTalk's custom Python environment (You will need to run 1 again after)
-echo 3) Install the Finetuning requirements (You need to have created the AllTalk custom environment)
-echo 4) Generate a diagnostics file (You need to have created the AllTalk custom environment)
+echo BASE REQUIREMENTS
+echo 1) Install AllTalk as a Standalone Application
echo.
-echo 9) Exit/Quit
+echo OPTIONAL
+echo 2) Delete AllTalk's custom Python environment
+echo 3) Install the Finetuning requirements
+echo.
+echo. OTHER
+echo 4) Generate a diagnostics file
+echo.
+echo 9) %L_RED%Exit/Quit%RESET%
echo.
set /p StandaloneOption="Enter your choice: "
if "%StandaloneOption%"=="1" goto InstallCustomStandalone
@@ -83,18 +115,16 @@ goto StandaloneMenu
pip install -r requirements_nvidia.txt
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error installing the Nvidia requirements.
- echo Press any key to return to the menu.
+ echo There was an error installing the Nvidia requirements.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
Echo.
-echo *************************************************************************************
echo.
-Echo Nvidia machine requirements installed successfully.
+Echo Nvidia machine requirements installed successfully.
Echo.
-echo *************************************************************************************
pause
goto WebUIMenu
@@ -102,18 +132,16 @@ goto WebUIMenu
pip install -r requirements_other.txt
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error installing the Other requirements.
- echo Press any key to return to the menu.
+ echo There was an error installing the Other requirements.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
Echo.
-echo *************************************************************************************
echo.
-Echo Other machine requirements installed successfully.
+Echo Other machine requirements installed successfully.
Echo.
-echo *************************************************************************************
pause
goto WebUIMenu
@@ -121,20 +149,17 @@ goto WebUIMenu
pip install -r requirements_finetune.txt
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error installing the Finetune requirements.
- echo Press any key to return to the menu.
+ echo There was an error installing the Finetune requirements.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
Echo.
-Echo ******************************************************************************************************
+Echo Finetune requirements installed successfully. Please ensure you have installed CUDA 11.8.
+Echo Finetune needs access to %L_GREEN%cublas64_11.dll%RESET% and will error if this is not setup correctly.
+Echo Please see here for details %L_GREEN%https://github.com/erew123/alltalk_tts#-finetuning-a-model%RESET%
Echo.
-Echo Finetune requirements installed successfully. Please ensure you have installed CUDA 11.8 requirements.
-Echo Finetune needs access to cublas64_11.dll and will error if this is not setup correctly.
-Echo Please see here for details https://github.com/erew123/alltalk_tts#-finetuning-a-model
-Echo.
-Echo ******************************************************************************************************
pause
goto WebUIMenu
@@ -143,9 +168,9 @@ echo Downloading DeepSpeed...
curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
if %ERRORLEVEL% neq 0 (
echo.
- echo Failed to download DeepSpeed wheel file.
- echo Please check your internet connection or try again later.
- echo Press any key to return to the menu.
+ echo Failed to download DeepSpeed wheel file.
+ echo Please check your internet connection or try again later.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
@@ -155,19 +180,17 @@ echo Installing DeepSpeed...
pip install deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
if %ERRORLEVEL% neq 0 (
echo.
- echo Failed to install DeepSpeed.
- echo Please check if the wheel file is compatible with your system.
- echo Press any key to return to the menu.
+ echo Failed to install DeepSpeed.
+ echo Please check if the wheel file is compatible with your system.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
Echo.
-echo *************************************************************************************
echo.
-Echo DeepSpeed installed successfully.
+Echo DeepSpeed installed successfully.
Echo.
-echo *************************************************************************************
del deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
pause
goto WebUIMenu
@@ -177,31 +200,29 @@ echo Downloading DeepSpeed...
curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
if %ERRORLEVEL% neq 0 (
echo.
- echo Failed to download DeepSpeed wheel file.
- echo Please check your internet connection or try again later.
- echo Press any key to return to the menu.
+ echo Failed to download DeepSpeed wheel file.
+ echo Please check your internet connection or try again later.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
-echo DeepSpeed wheel file downloaded successfully.
-echo Installing DeepSpeed...
+echo DeepSpeed wheel file downloaded successfully.
+echo Installing DeepSpeed...
pip install deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
if %ERRORLEVEL% neq 0 (
echo.
- echo Failed to install DeepSpeed.
- echo Please check if the wheel file is compatible with your system.
- echo Press any key to return to the menu.
+ echo Failed to install DeepSpeed.
+ echo Please check if the wheel file is compatible with your system.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
Echo.
-echo *************************************************************************************
echo.
-Echo DeepSpeed installed successfully.
+Echo DeepSpeed installed successfully.
Echo.
-echo *************************************************************************************
del deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
pause
goto WebUIMenu
@@ -210,17 +231,15 @@ goto WebUIMenu
pip uninstall deepspeed
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error uninstalling DeepSpeed.
- echo Press any key to return to the menu.
+ echo There was an error uninstalling DeepSpeed.
+ echo Press any key to return to the menu.
echo.
pause
goto WebUIMenu
)
-echo *************************************************************************************
echo.
-Echo DeepSpeed uninstalled successfully.
+Echo DeepSpeed uninstalled successfully.
Echo.
-echo *************************************************************************************
pause
goto WebUIMenu
@@ -228,17 +247,16 @@ goto WebUIMenu
Python diagnostics.py
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error running diagnostics. Have you correctly started your
- echo Text-generation-webui Python environment with "cmd_windows.bat"?
+ echo There was an error running diagnostics. Have you correctly started your
+ echo Text-generation-webui Python environment with %L_GREEN%cmd_windows.bat%RESET%?
+ echo.
pause
goto WebUIMenu
)
Echo.
-echo *************************************************************************************
echo.
-Echo Diagnostics.log generated. Please scroll up to look over the log.
+Echo Diagnostics.log generated. Please scroll up to look over the log.
Echo.
-echo *************************************************************************************
pause
goto WebUIMenu
@@ -303,14 +321,12 @@ if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
@rem Ask user for the type of requirements to install
-echo *************************************************************************************
echo.
-echo Choose the type of requirements to install (this will take 10-20 minutes to install):
+echo %L_BLUE%Choose the type of requirements to install%RESET%
echo.
-echo 1. Nvidia graphics card machines
-echo 2. Other machines (mac, amd, etc)
+echo 1. Nvidia graphics card machines
+echo 2. Other machines (mac, amd, etc)
echo.
-echo *************************************************************************************
set /p UserChoice="Enter your choice (1 or 2): "
@rem Install requirements based on user choice
@@ -354,13 +370,8 @@ echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
echo call python script.py >> start_alltalk.bat
echo exit >> start_alltalk.bat
Echo.
-Echo *************************************************************************************
-Echo.
-Echo "start_alltalk.bat" has been created.
-Echo.
-Echo You can now start AllTalk with "start_alltalk.bat"
-Echo.
-Echo *************************************************************************************
+Echo start_alltalk.bat has been created.
+Echo You can now start AllTalk with %L_YELLOW%start_alltalk.bat%RESET%
Echo.
pause
goto StandaloneMenu
@@ -369,7 +380,7 @@ goto StandaloneMenu
@rem Check if the alltalk_environment directory exists
if not exist "%cd%\alltalk_environment\" (
echo.
- echo "alltalk_environment" directory does not exist. No need to delete.
+ echo %L_GREEN%alltalk_environment%RESET% directory does not exist. No need to delete.
echo.
pause
goto StandaloneMenu
@@ -377,7 +388,7 @@ if not exist "%cd%\alltalk_environment\" (
@rem Check if a Conda environment is active
if not defined CONDA_PREFIX goto NoCondaEnvDeleteCustomStandalone
@rem Deactivate Conda environment if it's active
-Echo Exiting the Conda Environment. Please run "atsetup.bat" again and delete the environment.
+Echo Exiting the Conda Environment. Please run %L_GREEN%atsetup.bat%RESET% again and delete the environment.
conda deactivate
:NoCondaEnvDeleteCustomStandalone
echo Deleting "alltalk_environment". Please wait.
@@ -385,18 +396,16 @@ rd /s /q "alltalk_environment"
del start_alltalk.bat
if %ERRORLEVEL% neq 0 (
echo.
- echo Failed to delete "alltalk_environment" folder.
- echo Please make sure it is not in use and try again.
+ echo Failed to delete alltalk_environment folder.
+ echo Please make sure it is not in use and try again.
echo.
pause
goto StandaloneMenu
)
echo.
-Echo *************************************************************************************
Echo.
-echo Environment "alltalk_environment" deleted. Please set up the environment again.
+echo Environment %L_GREEN%alltalk_environment%RESET% deleted. Please set up the environment again.
Echo.
-Echo *************************************************************************************
pause
goto StandaloneMenu
@@ -407,8 +416,8 @@ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
@rem Check if the Conda environment exists
if not exist "%INSTALL_ENV_DIR%\python.exe" (
echo.
- echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
- echo Please install the environment before proceeding.
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
+ echo Please install the environment before proceeding.
echo.
pause
goto StandaloneMenu
@@ -417,8 +426,8 @@ if not exist "%INSTALL_ENV_DIR%\python.exe" (
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
if errorlevel 1 (
echo.
- echo Failed to activate the Conda environment.
- echo Please check your installation and try again.
+ echo Failed to activate the Conda environment.
+ echo Please check your installation and try again.
echo.
pause
goto StandaloneMenu
@@ -427,20 +436,17 @@ if errorlevel 1 (
pip install -r requirements_finetune.txt
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error installing the Finetune requirements.
- echo Press any key to return to the menu.
+ echo There was an error installing the Finetune requirements.
+ echo Press any key to return to the menu.
echo.
pause
goto StandaloneMenu
)
Echo.
-Echo ******************************************************************************************************
+Echo Finetune requirements installed successfully. Please ensure you have installed CUDA 11.8.
+Echo Finetune needs access to %L_GREEN%cublas64_11.dll%RESET% and will error if this is not setup correctly.
+Echo Please see here for details %L_GREEN%https://github.com/erew123/alltalk_tts#-finetuning-a-model%RESET%
Echo.
-Echo Finetune requirements installed successfully. Please ensure you have installed CUDA 11.8 requirements.
-Echo Finetune needs access to cublas64_11.dll and will error if this is not setup correctly.
-Echo Please see here for details https://github.com/erew123/alltalk_tts#-finetuning-a-model
-Echo.
-Echo ******************************************************************************************************
pause
goto StandaloneMenu
@@ -451,8 +457,8 @@ set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
@rem Check if the Conda environment exists
if not exist "%INSTALL_ENV_DIR%\python.exe" (
echo.
- echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
- echo Please install the environment before proceeding.
+ echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
+ echo Please install the environment before proceeding.
echo.
pause
goto StandaloneMenu
@@ -461,8 +467,8 @@ if not exist "%INSTALL_ENV_DIR%\python.exe" (
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
if errorlevel 1 (
echo.
- echo Failed to activate the Conda environment.
- echo Please check your installation and try again.
+ echo Failed to activate the Conda environment.
+ echo Please check your installation and try again.
echo.
pause
goto StandaloneMenu
@@ -471,18 +477,16 @@ if errorlevel 1 (
Python diagnostics.py
if %ERRORLEVEL% neq 0 (
echo.
- echo There was an error running diagnostics.
- echo Press any key to return to the menu.
+ echo There was an error running diagnostics.
+ echo Press any key to return to the menu.
echo.
pause
goto StandaloneMenu
)
Echo.
-Echo *************************************************************************************
Echo.
-Echo Diagnostics.log generated. Please scroll up to look over the log.
+Echo Diagnostics.log generated. Please scroll up to look over the log.
Echo.
-Echo *************************************************************************************
pause
goto StandaloneMenu
From 33264554cd4a316fc258dded63d0d51dbce912c7 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 13:46:02 +0000
Subject: [PATCH 28/61] Update README.md
---
README.md | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/README.md b/README.md
index 9afa732..6a63917 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,45 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
Please check the below link to find a list of all recent updates and changes.
#### 🔄 **Updates list & bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
+## 🟩 Quick Setup (Text-generation-webui & Standalone Installation)
+For Windows 10/11 and Linux machines there is a quick setup script.
+
+ (Click to expand) QUICK SETUP - Text-Generation-webui
+
+1) To download the AllTalk setup you can either:
+ - A) On this page select **CODE** > **Download ZIP** then extract it to the text-generation-webui extensions folder e.g. `\text-generation-webui\extensions\alltalk_tts\`
+ - B) Go to a terminal/console, move into the `\text-generation-webui\extensions\` folder and `git clone https://github.com/erew123/alltalk_tts`
+3) In a terminal/command prompt, in the text-generation-webui folder you will start its Python environment with either `cmd_windows.bat` or `./cmd_linux.sh`
+4) Move into the AllTalk folder e.g. `cd extensions` then `cd alltalk_tts`
+5) Start the AllTalk setup script `atsetup.bat` or `./atsetup.sh`
+6) Follow the on-screen prompts and install the correct requirements files that you need. It's recommended to test AllTalk works before installing DeepSpeed.
+
+ Any time you need to make changes to AllTalk, or use Finetuning etc, always start the Text-generation-webui Python environment first.
+
+ Finetuning & DeepSpeed have other installation requirements (depending on your OS) so please read any instructions in the setup utility and refer back here to this page for detailed instructions (as needed).
+
+
+ (Click to expand) QUICK SETUP - Standalone Installation
+
+1) To download the AllTalk setup you can either:
+ - A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
+ - B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
+4) In a terminal/command prompt, move into the AllTalk folder e.g. `cd alltalk_tts`
+5) Start the AllTalk setup script `atsetup.bat` or `./atsetup.sh`
+6) Follow the on-screen prompts and install the correct requirements files that you need. It's recommended to test AllTalk works before installing DeepSpeed.
+
+ DeepSpeed on Windows machines will be installed as standard. Linux machines have other requirements which are detailed within the setup utility and on this page.
+
+ Finetuning has other installation requirements so please read any instructions in the setup utility and refer back here to this page for detailed instructions.
+
+
+
+
## 🟩 Installation on Text generation web UI
+On Mac's or if you wish to perform a manual installation, please expand the below.
+
+ (Click to expand) MANUAL INSTALLATION - Text-Generation-webui
+
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
- If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
@@ -64,6 +102,7 @@ This has been tested on the current Dec 2023 release of Text generation webUI. I
10) Please read the note below about start-up times and also the note about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#the-one-thing-i-cant-easily-work-around)
11) Some extra voices downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
+
#### 🟩 Other installation notes
On first startup, AllTalk will download the Coqui XTTSv2 2.0.2 model to its **models** folder (1.8GB space required). Check the command prompt/terminal window if you want to know what its doing. After it says "Model Loaded" the Text generation webUI is usually available on its IP address a few seconds later, for you to connect to in your browser.
From 8dd11541b42f90e126a4cf5b1e86056953f5bf36 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 14:05:44 +0000
Subject: [PATCH 29/61] Update README.md
---
README.md | 90 +++++++++++++++++++++++++++++--------------------------
1 file changed, 48 insertions(+), 42 deletions(-)
diff --git a/README.md b/README.md
index e045f9d..0f0ae18 100644
--- a/README.md
+++ b/README.md
@@ -64,9 +64,7 @@ For Windows 10/11 and Linux machines there is a quick setup script.
Finetuning has other installation requirements so please read any instructions in the setup utility and refer back here to this page for detailed instructions.
-
-
-## 🟩 Installation on Text generation web UI
+## 🟩 Manual Installation - As part of Text generation web UI
On Mac's or if you wish to perform a manual installation, please expand the below.
(Click to expand) MANUAL INSTALLATION - Text-Generation-webui
@@ -98,12 +96,52 @@ This has been tested on the current Dec 2023 release of Text generation webUI. I
7) **(Optional DeepSpeed)** If you have an Nvidia Graphics card on a system running Linux or Windows and wish to use **DeepSpeed** please follow these instructions [here](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options). **However**, I would highly reccommend before you install DeepSpeed, you start text-generation-webui up, confirm AllTalk starts correctly and everything is working, as DeepSpeed can add another layer of complications troubleshooting any potential start-up issues. If necessary you can `pip uninstall deepspeed`.
8) You can now start move back to the main Text generation webUI folder `cd ..` (a few times), start Text generation webUI with whichever **one** of the startup scripts is correct for your OS (`start_windows.bat`,`./start_linux.sh`, `start_macos.sh` or `start_wsl.bat`) and load the AllTalk extension in the Text generation webUI **session** tab.
Starting Text-generation-webui with its correct start-up script is $\textcolor{red}{\textsf{VERY IMPORTANT}}$.
-
-10) Please read the note below about start-up times and also the note about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#the-one-thing-i-cant-easily-work-around)
-11) Some extra voices downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
+## 🟩 Manual Installation - As a Standalone Application
+On Mac's or if you wish to perform a manual installation, please expand the below.
+
+ (Click to expand) MANUAL INSTALLATION - I want to run AllTalk as a standalone when installed with Text-generation-webui
+
+If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
+
+
+ (Click to expand) MANUAL INSTALLATION - I wish to do a custom install of AllTalk
+
+AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
+
+Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python **3.11.x**.
+
+#### 🔹 A very quick understanding of Python Environments.
+Different Python applications have different requirements, some of those requirement’s conflict with other Python applications requirements. To work around this problem, you can create different Python environments that remain separated from one another. A simple way of looking at Python environments, is just like how your house has different rooms for specific purposes (Kitchen, Bathroom, Bedroom etc). You can create a Python environment that is built/customised specifically for your current applications needs/purposes and will **not** interfere with any other Python applications environments/installations.
If you are adept at managing Python environments, have an existing Python environment and know that you won’t cause any conflicts by installing AllTalk's requirements within that Python environment, then load up your Python environment and install the requirements. For everyone else, here is a basic guide on installing AllTalk in its own custom Python environment (there will be small variations between OS's, but the principle is the same).
+
+**Note:** A standard VENV can cause module path issues, hence Conda is the correct method to create a Python environment for AllTalk.
+
+#### 🔹 Building a custom Python Environment with Miniconda
+1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
+
+2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
+
+3) In your Anaconda Prompt command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`. So you will:
+
+4) Now we will create our custom Conda Python 3.11.5 environment and give it the name alltalkenv by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` environment. So type the following:
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
+
+5) **If you are NOT using an Nvidia card and CUDA, skip to step 6**. To force PyTorch to install with CUDA, perform the following:
`pip cache purge` (Clear the current Pip cache)
`pip uninstall torch torchaudio` (Uninstall Torch and Torchaudio from the `alltalkenv` environment)
+You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
+
+🔹Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
+
+Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
+
+
+
#### 🟩 Other installation notes
On first startup, AllTalk will download the Coqui XTTSv2 2.0.2 model to its **models** folder (1.8GB space required). Check the command prompt/terminal window if you want to know what its doing. After it says "Model Loaded" the Text generation webUI is usually available on its IP address a few seconds later, for you to connect to in your browser.
@@ -111,6 +149,10 @@ Once the extension is loaded, please find all documentation and settings on the
**Where to find voices** https://aiartes.com/voiceai or https://commons.wikimedia.org/ or interviews on youtube etc. Instructions on how to cut down and prepare a voice sample are within the built in documentation.
+Please read the note below about start-up times and also the note about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#the-one-thing-i-cant-easily-work-around)
+
+Some extra voices for AllTalk are downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
+
#### 🟩 The one thing I cant easily work around
Messages intended for the Narrator should be enclosed in asterisks `*` and those for the character inside quotation marks `"`. However, AI systems often deviate from these rules, resulting in text that is neither in quotes nor asterisks. Sometimes, text may appear with only a single asterisk, and AI models may vary their formatting mid-conversation. For example, they might use asterisks initially and then switch to unmarked text. A properly formatted line should look like this:
@@ -567,42 +609,6 @@ def get_shm_size():
**Removal** - If it became necessary to uninstall DeepSpeed, you can do so with `cmd_windows.bat` and then `pip uninstall deepspeed`
-## 🟦 Running AllTalk as a standalone app
-AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
-
-Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python **3.11.x**.
-
-#### 🟦 (Option 1) I already have AllTalk installed as an extension of Text-generation-webui
-If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
-
-#### 🟦 (Option 2) I wish to do a custom install of AllTalk
-#### 🔹 A very quick understanding of Python Environments.
-Different Python applications have different requirements, some of those requirement’s conflict with other Python applications requirements. To work around this problem, you can create different Python environments that remain separated from one another. A simple way of looking at Python environments, is just like how your house has different rooms for specific purposes (Kitchen, Bathroom, Bedroom etc). You can create a Python environment that is built/customised specifically for your current applications needs/purposes and will **not** interfere with any other Python applications environments/installations.
If you are adept at managing Python environments, have an existing Python environment and know that you won’t cause any conflicts by installing AllTalk's requirements within that Python environment, then load up your Python environment and install the requirements. For everyone else, here is a basic guide on installing AllTalk in its own custom Python environment (there will be small variations between OS's, but the principle is the same).
-
-**Note:** A standard VENV can cause module path issues, hence Conda is the correct method to create a Python environment for AllTalk.
-
-#### 🔹 Building a custom Python Environment with Miniconda
-1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
-
-2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
-
-3) In your Anaconda Prompt command prompt/terminal, move into the folder where you want to download AllTalk to and then git clone this repository. For simplicity I am going to assume that location is `c:\myfiles\`. So you will:
-
-4) Now we will create our custom Conda Python 3.11.5 environment and give it the name alltalkenv by typing the following at the prompt:
`conda create --name alltalkenv python=3.11.5`
You will be prompted if you want to continue and you say yes.
Once that process has completed, we now need to change from the `(base)` Conda Python environment, to our newly created `(alltalkenv)` environment. So type the following:
`conda activate alltalkenv`
Your prompt should now change from `(base) C:\myfiles\>` to `(alltalkenv) C:\myfiles\>`
-
-5) **If you are NOT using an Nvidia card and CUDA, skip to step 6**. To force PyTorch to install with CUDA, perform the following:
`pip cache purge` (Clear the current Pip cache)
`pip uninstall torch torchaudio` (Uninstall Torch and Torchaudio from the `alltalkenv` environment)
-You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio with **one** of the following
-
-🔹Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
-
-Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
-
## ⬜ AllTalk TTS Generator
AllTalk TTS Generator is the solution for converting large volumes of text into speech using the voice of your choice. Whether you're creating audio content or just want to hear text read aloud, the TTS Generator is equipped to handle it all efficiently. Please see here for a quick [demo](https://www.youtube.com/watch?v=hunvXn0mLzc)
The link to open the TTS generator can be found on the built-in Settings and Documentation page.
**DeepSpeed** is **highly** recommended to speed up generation. **Low VRAM** would be best turned off and your LLM model unloaded from your GPU VRAM (unload your model). **No Playback** will reduce memory overhead on very large generations (15,000 words or more). Splitting **Export to Wav** into smaller groups will also reduce memory overhead at the point of exporting your wav files (so good for low memory systems).
From 74ce2584ccbea9ebdc33b983e3c224597d419d75 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 14:27:53 +0000
Subject: [PATCH 30/61] Update README.md
---
README.md | 69 +++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 52 insertions(+), 17 deletions(-)
diff --git a/README.md b/README.md
index 0f0ae18..da37612 100644
--- a/README.md
+++ b/README.md
@@ -17,25 +17,24 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
## Index
-- 🟩 [Installation](https://github.com/erew123/alltalk_tts?#-installation-on-text-generation-web-ui)
+- 🟩 [Installation](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)
- 🟪 [Updating & problems with updating](https://github.com/erew123/alltalk_tts?#-updating)
- 🟫 [Screenshots](https://github.com/erew123/alltalk_tts#-screenshots)
- 🟨 [Help with problems](https://github.com/erew123/alltalk_tts?#-help-with-problems)
- ⚫ [Finetuning a model](https://github.com/erew123/alltalk_tts?#-finetuning-a-model)
- 🔵🟢🟡 [DeepSpeed Installation (Windows & Linux)](https://github.com/erew123/alltalk_tts?#-deepspeed-installation-options)
-- 🟦 [Running AllTalk as a standalone app](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
- ⬜ [AllTalk TTS Generator](https://github.com/erew123/alltalk_tts?#-alltalk-tts-generator)
- 🟠 [API Suite and JSON-CURL](https://github.com/erew123/alltalk_tts?#-api-suite-and-json-curl)
- 🔴 [Future to-do list & Upcoming updates](https://github.com/erew123/alltalk_tts?#-future-to-do-list)
-## 🔄 Updates
+## 🔄 Updates & Bug fixes
Please check the below link to find a list of all recent updates and changes.
#### 🔄 **Updates list & bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
## 🟩 Quick Setup (Text-generation-webui & Standalone Installation)
-For Windows 10/11 and Linux machines there is a quick setup script.
+For Windows 10/11 and Linux machines there is a quick setup script. Click to expand the correct section below:
- (Click to expand) QUICK SETUP - Text-Generation-webui
+ QUICK SETUP - Text-Generation-webui
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the text-generation-webui extensions folder e.g. `\text-generation-webui\extensions\alltalk_tts\`
@@ -47,10 +46,12 @@ For Windows 10/11 and Linux machines there is a quick setup script.
Any time you need to make changes to AllTalk, or use Finetuning etc, always start the Text-generation-webui Python environment first.
+ Please read the `🟩 Other installation notes` (also additional voices are available there).
+
Finetuning & DeepSpeed have other installation requirements (depending on your OS) so please read any instructions in the setup utility and refer back here to this page for detailed instructions (as needed).
- (Click to expand) QUICK SETUP - Standalone Installation
+ QUICK SETUP - Standalone Installation
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
@@ -61,13 +62,15 @@ For Windows 10/11 and Linux machines there is a quick setup script.
DeepSpeed on Windows machines will be installed as standard. Linux machines have other requirements which are detailed within the setup utility and on this page.
+ Please read the `🟩 Other installation notes` (also additional voices are available there).
+
Finetuning has other installation requirements so please read any instructions in the setup utility and refer back here to this page for detailed instructions.
## 🟩 Manual Installation - As part of Text generation web UI
-On Mac's or if you wish to perform a manual installation, please expand the below.
+On Mac's or if you wish to perform a manual installation. Click to expand the correct section below:
- (Click to expand) MANUAL INSTALLATION - Text-Generation-webui
+ MANUAL INSTALLATION - Text-Generation-webui
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
@@ -97,28 +100,34 @@ This has been tested on the current Dec 2023 release of Text generation webUI. I
8) You can now start move back to the main Text generation webUI folder `cd ..` (a few times), start Text generation webUI with whichever **one** of the startup scripts is correct for your OS (`start_windows.bat`,`./start_linux.sh`, `start_macos.sh` or `start_wsl.bat`) and load the AllTalk extension in the Text generation webUI **session** tab.
Starting Text-generation-webui with its correct start-up script is $\textcolor{red}{\textsf{VERY IMPORTANT}}$.
+ Any time you need to make changes to AllTalk, or use Finetuning etc, always start the Text-generation-webui Python environment first.
+
+ Please read the `🟩 Other installation notes` (also additional voices are available there).
+
+ Finetuning & DeepSpeed have other installation requirements (depending on your OS) so please read any instructions in the setup utility and refer back here to this page for detailed instructions (as needed).
+
## 🟩 Manual Installation - As a Standalone Application
-On Mac's or if you wish to perform a manual installation, please expand the below.
+On Mac's or if you wish to perform a manual installation. Click to expand the correct section below:
- (Click to expand) MANUAL INSTALLATION - I want to run AllTalk as a standalone when installed with Text-generation-webui
+ MANUAL INSTALLATION - I want to run AllTalk as a standalone when installed with Text-generation-webui
If you already have AllTalk as a extension of Text-generation-webui, and wish to run it as standalone, load Text-generation-webui's Python environment `cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`, move into the AllTalk folder `cd extensions` > `cd alltalk_tts` and start AllTalk with `python script.py`. There is nothing beyond this you would need to do.
- (Click to expand) MANUAL INSTALLATION - I wish to do a custom install of AllTalk
+ MANUAL INSTALLATION - I wish to do a custom install of AllTalk
AllTalk will run as a standalone app, as long as you install its requirements files into whatever Python environment you are using. You can follow the steps to install the AllTalk's requirements into whatever Python environment you wish. Because I dont know what Python environment you are wanting to use, I can only give you a loose set of installation instructions.
Please note, at time of writing, the TTS engine requires Python **3.9.x** to **3.11.x** [TTS Engine details here](https://pypi.org/project/TTS/). AllTalk and its requirements are tested on Python **3.11.x**.
-#### 🔹 A very quick understanding of Python Environments.
+#### 🟩 A very quick understanding of Python Environments.
Different Python applications have different requirements, some of those requirement’s conflict with other Python applications requirements. To work around this problem, you can create different Python environments that remain separated from one another. A simple way of looking at Python environments, is just like how your house has different rooms for specific purposes (Kitchen, Bathroom, Bedroom etc). You can create a Python environment that is built/customised specifically for your current applications needs/purposes and will **not** interfere with any other Python applications environments/installations.
If you are adept at managing Python environments, have an existing Python environment and know that you won’t cause any conflicts by installing AllTalk's requirements within that Python environment, then load up your Python environment and install the requirements. For everyone else, here is a basic guide on installing AllTalk in its own custom Python environment (there will be small variations between OS's, but the principle is the same).
**Note:** A standard VENV can cause module path issues, hence Conda is the correct method to create a Python environment for AllTalk.
-#### 🔹 Building a custom Python Environment with Miniconda
+#### 🟩 Building a custom Python Environment with Miniconda
1) Open a terminal/command prompt, and confirm that both `python --version` and `pip` both work. Neither of them should give an error message. If they do you may need to install Python (and maybe Pip).
Once you have those working you can now continue on.
2) Assuming you don't already have Miniconda installed, we will need to download and install Minoconda as this is what we will use to build our custom Python environment.
Download the Miniconda version that is correct for your OS and then install it. Miniconda will create some items in your Start Menu or Application Launcher called something like `Anaconda Prompt`
You will start the `Anaconda Prompt` and your prompt in your terminal/command prompt will say something like:
`(base) C:\users\myaccount\>`
The important bit is that it has the `(base)`, the location after that doesn't matter. `(base)` signifies we are in the base conda Python environment and can now create custom Python environments with Conda.
@@ -136,9 +145,16 @@ You can now either install the CUDA 11.8 or 12.1 version of Torch and Torchaudio
7) Start AllTalk with `python script.py`
-🔹Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
+🟩 Anytime you wish to use AllTalk, update its requirements, install some other requirements such as DeepSpeed, you will need to start its Conda Python Environment in the terminal/prompt, which you will do with `conda activate alltalkenv` as long as the Conda executable is accessible at the command prompt/terminal you are in.
It is fully possible to create a batch file or script file that you can use as a launcher from your Start Menu/Application Launcher that will start the environment and AllTalk for you.
Deepspeed and other such things can be installed. Please read the relevant instructions for those items, however, make the relevant changes to load your correct Python environment when installing any requirements files and starting AllTalk.
+
+ Any time you need to make changes to AllTalk, or use Finetuning etc, always start your Python environment first.
+
+ Please read the `🟩 Other installation notes` (also additional voices are available there).
+
+ Finetuning & DeepSpeed have other installation requirements (depending on your OS) so please read any instructions in the setup utility and refer back here to this page for detailed instructions (as needed).
+
@@ -153,7 +169,7 @@ Please read the note below about start-up times and also the note about ensuring
Some extra voices for AllTalk are downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
-#### 🟩 The one thing I cant easily work around
+#### 🟩 A note on Character Cards & Greeting Messages
Messages intended for the Narrator should be enclosed in asterisks `*` and those for the character inside quotation marks `"`. However, AI systems often deviate from these rules, resulting in text that is neither in quotes nor asterisks. Sometimes, text may appear with only a single asterisk, and AI models may vary their formatting mid-conversation. For example, they might use asterisks initially and then switch to unmarked text. A properly formatted line should look like this:
`"`Hey! I'm so excited to finally meet you. I've heard so many great things about you and I'm eager to pick your brain about computers.`"` `*`She walked across the room and picked up her cup of coffee`*`
@@ -163,14 +179,31 @@ Most narrator/character systems switch voices upon encountering an asterisk or q
With improvements to the splitter/processor, I'm confident it's functioning well. You can monitor what AllTalk identifies as Narrator lines on the command line and adjust its behavior if needed (Text Not Inside - Function).
## 🟪 Updating
+
+ UPDATING - I am using Text-Generation-webui
This is pretty much a repeat of the installation process.
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
`cd text-generation-webui` and start the Python environment for your OS with whichever **one** of the below is correct for your OS:
`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
-2) Move into your extensions and alltalk_tts folder:
-`cd extensions` then `cd alltalk_tts`
+2) Move into your extensions and alltalk_tts folder e.g. `cd extensions` then `cd alltalk_tts`
+
+3) At the command prompt/terminal, type `git pull`
+
+4) Install the correct requirements for your machine:
+
+
+ UPDATING - I am running as a Standalone Application
+This is pretty much a repeat of the installation process.
+
+1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
+`cd text-generation-webui` and start the Python environment for your OS with whichever **one** of the below is correct for your OS:
+`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
+
+2) Move into your alltalk_tts folder e.g. `cd alltalk_tts`
3) At the command prompt/terminal, type:
`git pull`
@@ -178,6 +211,8 @@ This is pretty much a repeat of the installation process.
4) Install the correct requirements for your machine:
**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`
+
+
#### 🟪 Updating "git pull" error
From 2790ee98602d678e4cd630c7d8b95ff2c9765476 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 14:42:31 +0000
Subject: [PATCH 31/61] added environment routine to atsetup.bat
---
atsetup.bat | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/atsetup.bat b/atsetup.bat
index 387dc70..b996754 100644
--- a/atsetup.bat
+++ b/atsetup.bat
@@ -361,6 +361,13 @@ if "%UserChoice%" == "1" (
pip install -r requirements_other.txt
)
+@rem Create start_environment.bat to run AllTalk environment
+echo @echo off > start_environment.bat
+echo cd /D "%~dp0" >> start_environment.bat
+echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_environment.bat
+echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_environment.bat
+echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_environment.bat
+echo exit >> start_environment.bat
@rem Create start_alltalk.bat to run AllTalk
echo @echo off > start_alltalk.bat
echo cd /D "%~dp0" >> start_alltalk.bat
@@ -394,6 +401,7 @@ conda deactivate
echo Deleting "alltalk_environment". Please wait.
rd /s /q "alltalk_environment"
del start_alltalk.bat
+del start_environment.bat
if %ERRORLEVEL% neq 0 (
echo.
echo Failed to delete alltalk_environment folder.
From 80b7fccb50273231f34e18f5383ae128ad508127 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 15:30:26 +0000
Subject: [PATCH 32/61] alltalk.sh adds env file.
---
atsetup.sh | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/atsetup.sh b/atsetup.sh
index 5712b1c..3700b82 100644
--- a/atsetup.sh
+++ b/atsetup.sh
@@ -314,7 +314,25 @@ install_custom_standalone() {
else
pip install -r requirements_other.txt
fi
-
+ # Create start_environment.sh to run AllTalk
+ cat << EOF > start_environment.sh
+#!/bin/bash
+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
+# config
+CONDA_ROOT_PREFIX="$(pwd)/alltalk_environment/conda"
+INSTALL_ENV_DIR="$(pwd)/alltalk_environment/env"
+# environment isolation
+export PYTHONNOUSERSITE=1
+unset PYTHONPATH
+unset PYTHONHOME
+export CUDA_PATH="$INSTALL_ENV_DIR"
+export CUDA_HOME="$CUDA_PATH"
+# activate env
+bash --init-file <(echo "source \"$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh\" && conda activate \"$INSTALL_ENV_DIR\"")
+EOF
# Create start_alltalk.sh to run AllTalk
cat << EOF > start_alltalk.sh
#!/bin/bash
@@ -323,6 +341,7 @@ conda activate "${INSTALL_ENV_DIR}"
python script.py
EOF
chmod +x start_alltalk.sh
+ chmod +x start_environment.sh
echo
echo
echo -e " start_alltalk.sh has been created."
From fe7ffb535cea77618fc01a41108deede60030bd5 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 15:31:45 +0000
Subject: [PATCH 33/61] 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 6e36415746416224bed8bc46005c2d53d2a7cef1 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 16:09:41 +0000
Subject: [PATCH 34/61] Update README.md
---
README.md | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index da37612..8e320f2 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# AllTalk TTS
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
-- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app) **or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts?#-installation-on-text-generation-web-ui)
+- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)**or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)
- **Model Finetuning:** Train the model specifically on a voice of your choosing for better reproduction.
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
- **Bulk TTS Generator/Editor:** Generate hours of TTS into one big file or have something read back to you [demo](https://www.youtube.com/watch?v=hunvXn0mLzc).
@@ -197,23 +197,16 @@ This is pretty much a repeat of the installation process.
UPDATING - I am running as a Standalone Application
-This is pretty much a repeat of the installation process.
+
+1) In a command prompt/terminal window you need to move into your `alltalk_tts` folder and run `start_environment.bat` or `/start_environment.sh` to load the Python environment.
-1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
-`cd text-generation-webui` and start the Python environment for your OS with whichever **one** of the below is correct for your OS:
-`cmd_windows.bat`, `./cmd_linux.sh`, `cmd_macos.sh` or `cmd_wsl.bat`
+2) At the command prompt/terminal, type `git pull` and wait for it to complete the download.
-2) Move into your alltalk_tts folder e.g. `cd alltalk_tts`
-
-3) At the command prompt/terminal, type:
-`git pull`
-
-4) Install the correct requirements for your machine:
+3) Install the correct requirements for your machine:
-
#### 🟪 Updating "git pull" error
From 83ac18b83f231ca2626adcc0cfdc1c42a8528d84 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 16:12:54 +0000
Subject: [PATCH 35/61] Update README.md
---
README.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 8e320f2..2d0cb01 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,6 @@ On Mac's or if you wish to perform a manual installation. Click to expand the co
This has been tested on the current Dec 2023 release of Text generation webUI. If you have not updated it for a while, you may wish to update Text generation webUI, [instructions here](https://github.com/oobabooga/text-generation-webui?tab=readme-ov-file#how-to-install)
- If you want to watch a video of how to do the below [link here](https://youtu.be/9BPKuwaav5w)
-- If you wish to install AllTalk as a **standalone application** without Text-generation-webui, please go to [this link here](https://github.com/erew123/alltalk_tts?#-running-alltalk-as-a-standalone-app)
1) In a command prompt/terminal window you need to move into your Text generation webUI folder:
`cd text-generation-webui`
@@ -165,7 +164,7 @@ Once the extension is loaded, please find all documentation and settings on the
**Where to find voices** https://aiartes.com/voiceai or https://commons.wikimedia.org/ or interviews on youtube etc. Instructions on how to cut down and prepare a voice sample are within the built in documentation.
-Please read the note below about start-up times and also the note about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#the-one-thing-i-cant-easily-work-around)
+Please read the note below about start-up times and also the note about ensuring your character cards are set up [correctly](https://github.com/erew123/alltalk_tts#-a-note-on-character-cards--greeting-messages)
Some extra voices for AllTalk are downloadable [here](https://drive.google.com/file/d/1bYdZdr3L69kmzUN3vSiqZmLRD7-A3M47/view?usp=drive_link)
From c2a558110b9c8d4912865f5c55dae3ab6e7cc480 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 16:13:11 +0000
Subject: [PATCH 36/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2d0cb01..f561b3f 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# AllTalk TTS
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
-- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)**or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)
+- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation) **or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)
- **Model Finetuning:** Train the model specifically on a voice of your choosing for better reproduction.
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
- **Bulk TTS Generator/Editor:** Generate hours of TTS into one big file or have something read back to you [demo](https://www.youtube.com/watch?v=hunvXn0mLzc).
From 30db974439f4f7c5b11c9bbf602bb3f480c8b62e Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Fri, 12 Jan 2024 16:17:55 +0000
Subject: [PATCH 37/61] Update README.md
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index f561b3f..557223f 100644
--- a/README.md
+++ b/README.md
@@ -511,6 +511,9 @@ If you set the `env` variable and you receive an error of `[Errno 2] No such fil
#### 🟢🟡 Windows Installation
+
+ Click to Expand: Windows DeepSpeed options
+
DeepSpeed v11.2 will work on the current default text-generation-webui Python 3.11 environment! You have 2x options for how to setup DeepSpeed on Windows. A quick way (🟢Option 1) and a long way (🟡Option 2).
Thanks to [@S95Sedan](https://github.com/S95Sedan) - They managed to get DeepSpeed 11.2 working on Windows via making some edits to the original Microsoft DeepSpeed v11.2 installation. The original post is [here](https://github.com/oobabooga/text-generation-webui/issues/4734#issuecomment-1843984142).
@@ -635,6 +638,7 @@ def get_shm_size():
**Removal** - If it became necessary to uninstall DeepSpeed, you can do so with `cmd_windows.bat` and then `pip uninstall deepspeed`
+
## ⬜ AllTalk TTS Generator
AllTalk TTS Generator is the solution for converting large volumes of text into speech using the voice of your choice. Whether you're creating audio content or just want to hear text read aloud, the TTS Generator is equipped to handle it all efficiently. Please see here for a quick [demo](https://www.youtube.com/watch?v=hunvXn0mLzc)
The link to open the TTS generator can be found on the built-in Settings and Documentation page.
**DeepSpeed** is **highly** recommended to speed up generation. **Low VRAM** would be best turned off and your LLM model unloaded from your GPU VRAM (unload your model). **No Playback** will reduce memory overhead on very large generations (15,000 words or more). Splitting **Export to Wav** into smaller groups will also reduce memory overhead at the point of exporting your wav files (so good for low memory systems).
From 5210d075c1312df4e8867913eaa79750f352906f Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 00:31:14 +0000
Subject: [PATCH 38/61] added an additional note to finetune.
---
finetune.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/finetune.py b/finetune.py
index 75aba76..5583137 100644
--- a/finetune.py
+++ b/finetune.py
@@ -917,7 +917,9 @@ if __name__ == "__main__":
#### - Place your audio files in {str(audio_folder)}
#### - Your audio samples can be in the format mp3, wav, or flac.
#### - You will need a minimum of 2 minutes of audio in either one or multiple audio files. Very small sample files cause errors, so I would suggest 30 seconds and longer samples.
- #### - When you have completed Steps 1, 2, and 3, you are welcome to delete your samples from "put-voice-samples-in-here".
+ #### - When you have completed Steps 1, 2, and 3, you are welcome to delete your samples from "put-voice-samples-in-here".
+ #### - FYI Anecdotal evidence suggests that the Whisper 2 model may yield superior results in audio splitting and dataset creation.
+ #### - If this step is failing, it will be worth running the diagnostics with atsetup and confirming you have cu118 or cu112 listed against your torch and torchaudio.
### 🟨 What this step is doing
#### - With step one, we are going to be stripping your audio file(s) into smaller files, using Whisper to find spoken words/sentences, compile that into excel sheets of training data, ready for finetuning the model on Step 2.
#### - Whilst you can choose multiple Whisper models, its best only to use the 1 model as each one is about 3GB in size and will download to your local huggingface cache on first-time use. If and when you have completed training, you wish to delete this 3GB model from your system, you are welcome to do so.
From 8dc9304a4c0d1202a7562a04afe50ebff09e0bf8 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 11:37:23 +0000
Subject: [PATCH 39/61] Update tts_server.py - _combined path
corrected _combined on narrated without timestamp
---
tts_server.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tts_server.py b/tts_server.py
index ca69597..65d6a44 100644
--- a/tts_server.py
+++ b/tts_server.py
@@ -978,8 +978,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 df70481934fbe324a7b2832df43838e0c88c3ace Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 14:43:19 +0000
Subject: [PATCH 40/61] Update README.md
---
README.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 557223f..a5a6e7d 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,8 @@ Please check the below link to find a list of all recent updates and changes.
For Windows 10/11 and Linux machines there is a quick setup script. Click to expand the correct section below:
QUICK SETUP - Text-Generation-webui
-
+
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the text-generation-webui extensions folder e.g. `\text-generation-webui\extensions\alltalk_tts\`
- B) Go to a terminal/console, move into the `\text-generation-webui\extensions\` folder and `git clone https://github.com/erew123/alltalk_tts`
@@ -52,7 +53,8 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
-
+
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
From 8c38e925dd4ebab10f6bcf1231626c31a89dcfa9 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 14:46:04 +0000
Subject: [PATCH 41/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index a5a6e7d..c124669 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Text-Generation-webui
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8)
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8){target="_blank"}
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the text-generation-webui extensions folder e.g. `\text-generation-webui\extensions\alltalk_tts\`
- B) Go to a terminal/console, move into the `\text-generation-webui\extensions\` folder and `git clone https://github.com/erew123/alltalk_tts`
@@ -54,7 +54,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs)
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs){target="_blank"}
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
From 0b1e6f87115102ca6529999dead3023d60b228c2 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 14:47:05 +0000
Subject: [PATCH 42/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c124669..6fcb039 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Text-Generation-webui
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8){target="_blank"}
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8){:target="_blank"}
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the text-generation-webui extensions folder e.g. `\text-generation-webui\extensions\alltalk_tts\`
- B) Go to a terminal/console, move into the `\text-generation-webui\extensions\` folder and `git clone https://github.com/erew123/alltalk_tts`
@@ -54,7 +54,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs){target="_blank"}
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs){:target="_blank"}
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
From 7a38730c56d156314c1b6735d3c5ac41c019c807 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 14:48:06 +0000
Subject: [PATCH 43/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 6fcb039..a5a6e7d 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Text-Generation-webui
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8){:target="_blank"}
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=icn2XS5rUH8)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the text-generation-webui extensions folder e.g. `\text-generation-webui\extensions\alltalk_tts\`
- B) Go to a terminal/console, move into the `\text-generation-webui\extensions\` folder and `git clone https://github.com/erew123/alltalk_tts`
@@ -54,7 +54,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs){:target="_blank"}
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
From c5846b832a06f9b5be2fcf3893c8c18dd11ac6aa Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 14:59:38 +0000
Subject: [PATCH 44/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a5a6e7d..c9ebd82 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=-hwdBKVI9bs)
+ If you wish to see this as a video, please go [here](https://youtu.be/icn2XS5rUH8)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
From c05237143b24479c65ae32847bab6103a93ecff7 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 15:28:45 +0000
Subject: [PATCH 45/61] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index c9ebd82..30ced30 100644
--- a/README.md
+++ b/README.md
@@ -269,6 +269,7 @@ Assuming its all working fine and you are happy, you can delete the old alltalk_
#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
#### 🟨 How to make a diagnostics report file
+If you are on a Windows machine or a Linux machine, you should be able to use the `atsetup.bat` or `./atsetup.sh` utility to create a diagnositcs file. If you are unable to use the `atsetup` utility, please follow the instructions below.
Click to expand
From f1b4d4b8b65ee2d781b81c4ecba3dd85c51d1df5 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 16:41:30 +0000
Subject: [PATCH 46/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 30ced30..a65543b 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
- If you wish to see this as a video, please go [here](https://youtu.be/icn2XS5rUH8)
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=YghLnMBZLXw)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
From 34d1b81ae4ece0e29ada70b8fa1dd56fd3699c32 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 18:20:35 +0000
Subject: [PATCH 47/61] Update README.md
---
README.md | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index a65543b..da3970f 100644
--- a/README.md
+++ b/README.md
@@ -259,14 +259,12 @@ Assuming its all working fine and you are happy, you can delete the old alltalk_
## 🟫 Screenshots
-| |  |
-|:---:|:---:|
-| |  |
-| |  |
-| |
+| |  |  | |
+|:---:|:---:|:---:|:---:|
+| |  |  ||
## 🟨 Help with problems
-#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
+## 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
#### 🟨 How to make a diagnostics report file
If you are on a Windows machine or a Linux machine, you should be able to use the `atsetup.bat` or `./atsetup.sh` utility to create a diagnositcs file. If you are unable to use the `atsetup` utility, please follow the instructions below.
From 471a26f2a43836f93c18411ba6fb3b5af5c7f546 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 18:23:48 +0000
Subject: [PATCH 48/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index da3970f..1c32966 100644
--- a/README.md
+++ b/README.md
@@ -259,9 +259,9 @@ Assuming its all working fine and you are happy, you can delete the old alltalk_
## 🟫 Screenshots
-| |  |  | |
+| |  |  | |
|:---:|:---:|:---:|:---:|
-| |  |  ||
+| |  |  ||
## 🟨 Help with problems
## 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
From cba7ed7b884f25fe360ce58e29f00608f83400ad Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 18:38:21 +0000
Subject: [PATCH 49/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1c32966..56a1f41 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ For Windows 10/11 and Linux machines there is a quick setup script. Click to exp
QUICK SETUP - Standalone Installation
- If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=YghLnMBZLXw)
+ If you wish to see this as a video, please go [here](https://www.youtube.com/watch?v=AQYCccDRbaY)
1) To download the AllTalk setup you can either:
- A) On this page select **CODE** > **Download ZIP** then extract it to the folder of your choice e.g. `C:\myfiles\alltalk_tts\`
- B) Go to a terminal/console, move into the folder of your choice e.g `C:\myfiles\` folder and `git clone https://github.com/erew123/alltalk_tts`
If you are wanting to generate bulk quantites of TTS and have control over them,
+
If you are wanting to generate bulk quantities of TTS and have control over them,
please see the AllTalk TTS Generator below.
`;
+html += `
+
+Text-generation-webui users - Uncheck Enable TTS in Text-generation-webui.
+
+
`;
+
+
+
return html;
}
From 139162c4e68f43a6b4b44193e426ae877e8bee6f Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 19:55:24 +0000
Subject: [PATCH 53/61] Update README.md
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 56a1f41..5cfbfb9 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,12 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
- **Model Finetuning:** Train the model specifically on a voice of your choosing for better reproduction.
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
- **Bulk TTS Generator/Editor:** Generate hours of TTS into one big file or have something read back to you [demo](https://www.youtube.com/watch?v=hunvXn0mLzc).
-- **DeepSpeed:** A 3-4x performance boost generating TTS. [DeepSpeed Windows/Linux Instructions](https://github.com/erew123/alltalk_tts?tab=readme-ov-file#deepspeed-installation-options) [Screenshot](https://github.com/erew123/alltalk_tts/assets/35898566/548619c8-5f1b-47d0-a73d-54d2fee3f3db)
-- **Low VRAM mode:** Great for people with small GPU memory or if your VRAM is filled by your LLM. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
-- **Custom Start-up Settings:** Adjust your default start-up settings. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
+- **DeepSpeed:** A 2-3x performance boost generating TTS. [Screenshot](https://github.com/erew123/screenshots/raw/main/deepspeed.jpg)
+- **Low VRAM mode:** Great for people with small GPU memory or if your VRAM is filled by your LLM.
+- **Custom Start-up Settings:** Adjust your default start-up settings. [Screenshot](https://github.com/erew123/screenshots/raw/main/settingsanddocs.jpg)
- **Narrarator:** Use different voices for main character and narration. [Example Narration](https://vocaroo.com/18nrv7FR6wuA)
-- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
-- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/alltalk_tts#screenshots)
+- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/screenshots/raw/main/settingsanddocs.jpg)
+- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/screenshots/raw/main/settingsanddocs.jpg)
- **Console output:** Clear command line output for any warnings or issues.
- **API Suite and 3rd Party support via JSON calls:** Can be used with 3rd party applications via JSON calls.
- **SillyTavern integration:** Full integration with SillyTavern.
From 2c1ca8b2a37b7e691b5bafd89c2a8b0088476af8 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 19:56:31 +0000
Subject: [PATCH 54/61] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 5cfbfb9..670e2c0 100644
--- a/README.md
+++ b/README.md
@@ -11,9 +11,9 @@ AllTalk is an updated version of the Coqui_tts extension for Text Generation web
- **Narrarator:** Use different voices for main character and narration. [Example Narration](https://vocaroo.com/18nrv7FR6wuA)
- **Optional wav file maintenance:** Configurable deletion of old output wav files. [Screenshot](https://github.com/erew123/screenshots/raw/main/settingsanddocs.jpg)
- **Documentation:** Fully documented with a built in webpage. [Screenshot](https://github.com/erew123/screenshots/raw/main/settingsanddocs.jpg)
-- **Console output:** Clear command line output for any warnings or issues.
+- **Clear Console output:** Clear command line output for any warnings or issues.
- **API Suite and 3rd Party support via JSON calls:** Can be used with 3rd party applications via JSON calls.
-- **SillyTavern integration:** Full integration with SillyTavern.
+- **SillyTavern integration:** Full integration with SillyTavern. [Screenshot](https://github.com/erew123/screenshots/raw/main/sillytavern.jpg)
## Index
From 43899028e35a40308761f8f7166c703f0ad3fbb0 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 19:59:10 +0000
Subject: [PATCH 55/61] Update README.md
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 670e2c0..e5368a3 100644
--- a/README.md
+++ b/README.md
@@ -264,7 +264,8 @@ Assuming its all working fine and you are happy, you can delete the old alltalk_
| |  |  ||
## 🟨 Help with problems
-## 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
+
+#### 🔄 **Minor updates/bug fixes list** can be found [here](https://github.com/erew123/alltalk_tts/issues/25)
#### 🟨 How to make a diagnostics report file
If you are on a Windows machine or a Linux machine, you should be able to use the `atsetup.bat` or `./atsetup.sh` utility to create a diagnositcs file. If you are unable to use the `atsetup` utility, please follow the instructions below.
From b987ff38a72a6eaba1eb23a08b41c18be83698b4 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 20:07:22 +0000
Subject: [PATCH 56/61] Update README.md
---
README.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index e5368a3..bd8b0af 100644
--- a/README.md
+++ b/README.md
@@ -761,7 +761,7 @@ Generate a preview of a specified voice with hardcoded settings.
JSON return `{"status": "lowvram-success"}`
-### 🟠 TTS Generation Endpoint
+### 🟠 TTS Generation Endpoint (Standard Generation)
- URL: `http://127.0.0.1:7851/api/tts-generate` - Method: `POST` - Content-Type: `application/x-www-form-urlencoded`
@@ -871,6 +871,9 @@ Example JSON TTS Generation Response:
### 🟠 Example command lines (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`
+
```
// Example parameters
const text = "Here is some text";
From 2351e418fdce18ccf5c875d5f0b016f51ee49473 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 20:13:38 +0000
Subject: [PATCH 57/61] Changed demo endpoint
---
templates/admin.html | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/templates/admin.html b/templates/admin.html
index 6be9e67..7fa5d11 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -436,11 +436,11 @@
if (formData.get('streaming') === 'true') {
// For streaming, update the audio player src
const searchParams = new URLSearchParams(formData).toString();
- audioPlayer.src = baseurl + "/tts-demo-request?" + searchParams;
+ audioPlayer.src = baseurl + "/api/tts-generate-streaming?" + searchParams;
audioPlayer.load(); // Reload the audio player
} else {
// For non-streaming, send a POST request
- const response = await fetch('/tts-demo-request', {
+ const response = await fetch('/api/tts-generate-streaming', {
method: 'POST',
body: formData,
cache: "no-store"
@@ -667,6 +667,19 @@
otherwise Text-generation-webui will also generate TTS due to the way it sends out text. You can do this
each time you start up Text-generation-webui or set it in the start-up settings at the top of this page.
+
Quick Tips
+
+
Only change DeepSpeed, Low VRAM or Model one at a time. Wait for it to say Ready before changing something
+ else.
+
You can permanently change the AllTalk startup settings or DeepSpeed, Low VRAM and Model at the top of this
+ page.
+
Different AI models use quotes and asterisks differently, so you may need to change "Text not inside"
+ depending on model.
+
Add new voice samples to the voices folder. You can Finetune a model to make it sound even closer to the
+ original sample.
+
DeepSpeed will improve processing time to TTS to be 2-3x faster.
+
Low VRAM can be very beneficial if you don't have much memory left after loading your LLM.
+
TTS Generation Methods in SilllyTavern
You have 2 types of audio generation options, Streaming and Standard.
The Streaming Audio Generation method is designed for speed and
@@ -933,7 +946,8 @@
DeepSpeed Setup - Windows
➡️DeepSpeed requires an Nvidia Graphics card!⬅️
-
The atsetup utility for Windows can install DeepSpeed for you (Stanalone users whom installed via the atsetup utility will already have DeepSpeed installed).
+
The atsetup utility for Windows can install DeepSpeed for you (Stanalone users whom
+ installed via the atsetup utility will already have DeepSpeed installed).
DeepSpeed v11.2 will work on the current default text-generation-webui Python 3.11
environment! You have 2x options for how to setup DeepSpeed on Windows. A quick way Option 1 and a long way
Date: Sat, 13 Jan 2024 20:22:10 +0000
Subject: [PATCH 58/61] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index bd8b0af..519ea53 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# AllTalk TTS
AllTalk is an updated version of the Coqui_tts extension for Text Generation web UI. Features include:
-- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation) **or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation)
+- **Can be run as a** [standalone](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation) **or part of** [Text-generation-webui](https://github.com/erew123/alltalk_tts/#-quick-setup-text-generation-webui--standalone-installation) **using the a quick setup utility**
- **Model Finetuning:** Train the model specifically on a voice of your choosing for better reproduction.
- **Local/Custom models:** Use any of the XTTSv2 models (API Local and XTTSv2 Local).
- **Bulk TTS Generator/Editor:** Generate hours of TTS into one big file or have something read back to you [demo](https://www.youtube.com/watch?v=hunvXn0mLzc).
From 467bfbea55fe0cc9ab31780154ba0a1201f999a8 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 21:07:18 +0000
Subject: [PATCH 59/61] Applied UUID to API generated TTS
To avoid over-writing if 2x generations happen quickly enough.
---
tts_server.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/tts_server.py b/tts_server.py
index d17fafc..4d2c48b 100644
--- a/tts_server.py
+++ b/tts_server.py
@@ -821,6 +821,7 @@ import uuid
import numpy as np
import soundfile as sf
import sys
+import hashlib
##############################
#### Streaming Generation ####
@@ -1061,13 +1062,20 @@ async def tts_generate(
else:
if output_file_timestamp:
timestamp = int(time.time())
- output_file_path = this_dir / "outputs" / f"{output_file_name}_{timestamp}.wav"
- output_file_url = f'http://{params["ip_address"]}:{params["port_number"]}/audio/{output_file_name}_{timestamp}.wav'
- output_cache_url = f'http://{params["ip_address"]}:{params["port_number"]}/audiocache/{output_file_name}_{timestamp}.wav'
+ # Generate a standard UUID
+ original_uuid = uuid.uuid4()
+ # Hash the UUID using SHA-256
+ hash_object = hashlib.sha256(str(original_uuid).encode())
+ hashed_uuid = hash_object.hexdigest()
+ # Truncate to the desired length, for example, 16 characters
+ short_uuid = hashed_uuid[:5]
+ output_file_path = this_dir / "outputs" / f"{output_file_name}_{timestamp}{short_uuid}.wav"
+ output_file_url = f'http://{params["ip_address"]}:{params["port_number"]}/audio/{output_file_name}_{timestamp}{short_uuid}.wav'
+ output_cache_url = f'http://{params["ip_address"]}:{params["port_number"]}/audiocache/{output_file_name}_{timestamp}{short_uuid}.wav'
else:
output_file_path = this_dir / "outputs" / f"{output_file_name}.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}_{timestamp}.wav'
+ output_cache_url = f'http://{params["ip_address"]}:{params["port_number"]}/audiocache/{output_file_name}.wav'
if text_filtering == "html":
cleaned_string = html.unescape(standard_filtering(text_input))
cleaned_string = re.sub(r'([!?.])\1+', r'\1', text_input)
From 571872dbe2b6cf37892319399d7597524378840f Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 21:16:01 +0000
Subject: [PATCH 60/61] Update README.md
---
README.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index 519ea53..430c6a2 100644
--- a/README.md
+++ b/README.md
@@ -708,14 +708,14 @@ Retrieve a list of available voices for generating speech.
`curl -X GET "http://127.0.0.1:7851/api/currentsettings"`
- JSON return: `{"models_available":[{"name":"Coqui","model_name":"API TTS"},{"name":"Coqui","model_name":"API Local"},{"name":"Coqui","model_name":"XTTSv2 Local"}],"current_model_loaded":"XTTSv2 Local","deepspeed_available":true,"deepspeed_status":true,"low_vram_status":true,"finetuned_model":false}
+ JSON return: ```{"models_available":[{"name":"Coqui","model_name":"API TTS"},{"name":"Coqui","model_name":"API Local"},{"name":"Coqui","model_name":"XTTSv2 Local"}],"current_model_loaded":"XTTSv2 Local","deepspeed_available":true,"deepspeed_status":true,"low_vram_status":true,"finetuned_model":false}```
- name & model_name = listing the currently available models.
- current_model_loaded = what model is currently loaded into VRAM.
- deepspeed_available = was DeepSpeed detected on startup and available to be activated.
- deepspeed_status = If DeepSpeed was detected, is it currently activated.
- low_vram_status = Is Low VRAM currently enabled.
- finetuned_model = Was a finetuned model detected. (XTTSv2 FT).
+ `name & model_name` = listing the currently available models.
+ `current_model_loaded` = what model is currently loaded into VRAM.
+ `deepspeed_available` = was DeepSpeed detected on startup and available to be activated.
+ `deepspeed_status` = If DeepSpeed was detected, is it currently activated.
+ `low_vram_status` = Is Low VRAM currently enabled.
+ `finetuned_model` = Was a finetuned model detected. (XTTSv2 FT).
#### 🟠 Preview Voice Endpoint
Generate a preview of a specified voice with hardcoded settings.
From 5c0f08d49e344770c85453622718aef7674cc9e4 Mon Sep 17 00:00:00 2001
From: erew123 <35898566+erew123@users.noreply.github.com>
Date: Sat, 13 Jan 2024 21:23:47 +0000
Subject: [PATCH 61/61] Update README.md
---
README.md | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 430c6a2..aa312d7 100644
--- a/README.md
+++ b/README.md
@@ -398,6 +398,7 @@ If you have a voice that the model doesnt quite reproduce correctly, or indeed y
- To install a few portions of the Nvidia CUDA 11.8 Toolkit (this will not impact text-generation-webui's cuda setup.
- 18GB of disk space free (most of this is used temporarily)
- At least 2 minutes of good quality speech from your chosen speaker in mp3, wav or flacc format, in one or more files (have tested as far as 20 minutes worth of audio).
+- As a side note, many people seem to think that the Whisper v2 model (used on Step 1) is giving better results at generating training datasets, so you may prefer to try that, as opposed to the Whisper 3 model.
#### ⚫ How will this work/How complicated is it?
Everything has been done to make this as simple as possible. At its simplest, you can literally just download a large chunk of audio from an interview, and tell the finetuning to strip through it, find spoken parts and build your dataset. You can literally click 4 buttons, then copy a few files and you are done. At it's more complicated end you will clean up the audio a little beforehand, but its still only 4x buttons and copying a few files.
@@ -406,8 +407,8 @@ Everything has been done to make this as simple as possible. At its simplest, yo
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.
#### ⚫ 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. 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)
+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)
- Run the installer. At minimum, you need to [minimally] install the `nvcc` compiler and the `CUBLAS` development and runtime libraries:
- Select **Custom Advanced** as your installation type.
- Uncheck all the checkboxes in the list.
@@ -426,6 +427,8 @@ As mentioned you must have a small portion of the Nvidia CUDA Toolkit **11.8** i
- When you have made the changes, open a **new** terminal/command prompt (in order to load the new search paths) and `nvcc --version`. It should report back `Cuda compilation tools, release 11.8.` at which point, you are good to go.
- If it doesn't report that, check you have correctly set the search environment paths, dont have overlapping other versions of cuda paths etc.
+**Note:** Its also important that your Torch and Torchaudio have cuda installed (of any version). If you run the AllTalk diagnostics you can see your Torch and Torchaudio versions listed there. Cuda 11.8 will be listed as `cu118` and Cuda 12.1 as `cu121`. This Torch and Torchaudio is seperate to the above requirement to have the Nvidia CUDA Toolkit installed, so dont confuse the two different requirements. If you dont have Cuda installed on Torch and Torchaudio, Step 2 of Finetuning will fail.
+
#### ⚫ Starting Finetuning
**NOTE:** Please make sure you have started AllTalk at least once after updating, so that it downloads the additional files needed for finetuning.