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/27] 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).

[Python Website](https://www.python.org/downloads/)
[Pip Website](https://pip.pypa.io/en/stable/installation/)

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.

[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)

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:

**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`

**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt` -5) Start AllTalk with `python script.py` +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. 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/27] 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).

[Python Website](https://www.python.org/downloads/)
[Pip Website](https://pip.pypa.io/en/stable/installation/)

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.

[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)

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.

[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)

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/27] 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 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:

**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`

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/27] 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 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:

+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`

**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`

**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/27] 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.

[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)

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/27] 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/27] 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).

[Python Website](https://www.python.org/downloads/)
[Pip Website](https://pip.pypa.io/en/stable/installation/)

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).

[Python Website](https://www.python.org/downloads/)
[Pip Website](https://pip.pypa.io/en/stable/installation/)

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.

[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)

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.

[Miniconda Website](https://docs.conda.io/projects/miniconda/en/latest/)

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:

`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. +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 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 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) 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:

`cd alltalk_tts`

**Nvidia graphics card machines** - `pip install -r requirements_nvidia.txt`

-**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt` +**Other machines (mac, amd etc)** - `pip install -r requirements_other.txt`

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. -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/27] 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/27] 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/27] 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/27] 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/27] 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/27] 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:

`cd text-generation-webui` From b223e7b2479e5cb14912f8a6e4ad7bb18f4842c6 Mon Sep 17 00:00:00 2001 From: erew123 <35898566+erew123@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:04:25 +0000 Subject: [PATCH 14/27] ST Documentation added --- templates/admin.html | 102 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/templates/admin.html b/templates/admin.html index ac595b7..d63fa1d 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -222,6 +222,7 @@
  • Using Voice Samples
  • Text Not inside
  • Low VRAM
  • +
  • Silly Tavern Support
  • Finetuning (Training the model)
  • DeepSpeed