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

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

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

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

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

+**Nvidia graphics card machines** - `pip install -r requirements_nvidia.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.

+
+ + #### 🟩 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).

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

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

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

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

-**Nvidia graphics card machines** - `pip install -r requirements_nvidia.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.

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