diff --git a/.gitignore b/.gitignore index 3b15e82..b18a0cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ voices/*.* models/*.* outputs/*.* +finetune/*.* config.json confignew.json models.json diff --git a/README.md b/README.md index f296956..61bf387 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,8 @@ I could force a delimeter in at this stage, but I know it would/may affect thing 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` +`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` @@ -276,7 +277,7 @@ Depending on which of your Nvidia GPU's is the more powerful one, you can change ## ⚫ Finetuning a model If you have a voice that the model doesnt quite reproduce correctly, or indeed you just want to improve the reproduced voice, then finetuning is a way to train your "XTTSv2 local" model **(stored in `/alltalk_tts/models/xxxxx/`)** on a specific voice. For this you will need: -- An Nvidia graphics card. (Please see this [note](https://github.com/erew123/alltalk_tts#i-have-multiple-gpus-and-i-have-problems-running-finetuning) if you have multiple Nvidia GPU's). +- An Nvidia graphics card. (Please see this [note](https://github.com/erew123/alltalk_tts#-i-have-multiple-gpus-and-i-have-problems-running-finetuning) if you have multiple Nvidia GPU's). - 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). diff --git a/finetune.py b/finetune.py index c94a725..75aba76 100644 --- a/finetune.py +++ b/finetune.py @@ -879,6 +879,7 @@ if __name__ == "__main__": ####      - Have you run AllTalk at least once? It needs to have downloaded+updated the voice model, before we can finetune it. ### 🟦 What you need to run finetuning ####      - An Nvidia GPU. Tested on Windows with extended shared VRAM and training used about 16GB's total (which worked on a 12GB card). + ####      - If you have multiple Nvidia GPU's in your system, please see this [important note](https://github.com/erew123/alltalk_tts#-i-have-multiple-gpus-and-i-have-problems-running-finetuning). ####      - I have not been able to test this on a GPU with less than 12GB of VRAM, so cannot say if it will work or how that would affect performance. ####      - Version 11.8 of Nvidia cuBLAS and cuDNN (guide below). Only 11.8 of cuBLAS and cuDNN work for this process currently. ####      - Minimum 18GB free disk space (most of it is used temporarily). diff --git a/script.py b/script.py index 94d2df8..3e6d98e 100644 --- a/script.py +++ b/script.py @@ -509,8 +509,11 @@ def voice_preview(string): return f"[{params['branding']}Server] Audio generation failed. Status: {generate_response.get('status')}" +#def replace_asterisk(match): +# return match.group(0) + '"<*' + def replace_asterisk(match): - return match.group(0) + '"<*' + return '"<*' ################################# #### TTS STANDARD GENERATION #### @@ -520,6 +523,7 @@ def output_modifier(string, state): if not params["activate"]: return string original_string = string + #print("ORIGINAL STRING IS:", original_string) cleaned_string = before_audio_generation(string, params) if cleaned_string is None: return @@ -558,6 +562,7 @@ def output_modifier(string, state): processed_string = processed_string.replace('* ', '* "<') processed_string = processed_string.replace('*. ', '* "<') processed_string = re.sub(r'\*(?=[a-zA-Z])', replace_asterisk, processed_string) + #print("PROCESSED STRING IS:", processed_string) # Set up a tracking of the individual wav files. audio_files_all_paragraphs = [] # Split the line using " and ".* " (so end of sentences, leaving special characters added to the start of all OTHER sentences, bar possibly the first one if its starting with a * @@ -569,6 +574,7 @@ def output_modifier(string, state): continue # Figure out which type of line it is, then replace characters as necessary to avoid TTS trying to pronunce them, htmlunescape after. # Character will always be a < with a letter immediately after it + #print("PART IS:", part) if '<' in part and '< *' not in part and '<*' not in part and '< *' not in part and '< ' not in part and '< ' not in part: cleaned_part = html.unescape(part.replace('<', '')) voice_to_use = params["voice"] @@ -578,9 +584,11 @@ def output_modifier(string, state): voice_to_use = params["narrator_voice"] #If the other two dont capture it, aka, the AI gave no * or " on the line, use non_quoted_text_is aka user interface, user can choose Char or Narrator elif non_quoted_text_is: + #print("HIT ELIF CHAR VOICE") cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', '')) voice_to_use = params["voice"] else: + #print("HIT ELIF NARRATOR VOICE") cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', '')) voice_to_use = params["narrator_voice"] # Generate that TTS and output to a file