Model trimming, Faster-whisper & more - #1
Open
EliseWindbloom wants to merge 30 commits into
Open
EliseWindbloom wants to merge 30 commits into
EliseWindbloom wants to merge 30 commits into
Conversation
adjust default settings for training/resume training and config file creation
default to "medium" whisper model (for balance between speed and quality), as "base" is good and faster but tends to have more transcription mistakes.
add cmd arguments
added faster-whisper
changed defaults for template to help with resuming training
removed changes, changed config.json template instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for creating this wonderful windows port, and i apologize if i'm creating this pull request incorrectly (i'm a newbie to doing pull requests).
I've made a number of changes in hopes of enhancing things and making things faster:
Training Resuming
melo/configs/config.jsontemplate:skip_optimizer=falseby default, which seems critical for resuming training later (if this is set to true, the model will not include the extra data required to resume training, if my understanding is correct).eval_interval=200by default to make it save the model more often by defaultkeep_ckpts=5to the config.json, this allows you to set how many models it will keep. It will delete models past this set value, starting from the oldest model.Model Trimming
I've discovered you can trim the model (about 66% smaller filesize on my tests). These created trimmed models should load faster i think too. Note the created files are for inference-only (as it removes the unneeded overhead from the model which seems required for training). Also it's possible this only makes the loading of the model faster and not the actual text-to-speech each time it's used.
trim_models.pyandtrim_models.bat. Edit the bat file with the path to your models and run the bat file, or run inside conda like this (outputted models with have the word "_trimmed" at the end of them):Audio files to wav (44100Hz sample rate)
ConvertAudiotoWav.batwhich allows you to convert a very wide range of common audio file formats to wav with 44100Hz sample rate (the sample rate recommended in MeloTTS training readme). create a folder namedaudio, place the audio it and run the bat file to make a folder calledwavswith the converted audio.Faster-Whisper
For far faster transcribing, i've added faster-whisper
transcript_fast.pyandtranscript_fast.bat, to use runtranscript_fast.batwhich will use the default directories. you can also add directories like this or run it in the conda prompt:transcript.pyandtranscript_fast.pyboth set to medium model. The faster-whisper model is using a nice hybrid int8_float16 compute type, which is a great balance between speed and quality from my tests.try.py Added
python try.pyto use it. it will automatically find any voices pth files placed in folder named "custom" (include a config json file with matching name for each one).Updated Readme
Extra Notes
You may want to test out faster-whisper on your pc just in case, but i think everything else should be fine without issue.
Some info when I tested training, in case it helps anyone (as i have no idea what the right amount of training is). For reference, my pc is runs Windows 10 and has a NVIDIA GTX 1650 with 4GB VRAM and 32GB RAM.
G_1000.pth, which would has the number "1000") is the "steps", which may be the same as the epoch count depending on settings or might be different.Also, installing faster-whisper seems to cause some kind of versions conflict, but running this command after installing faster-whisper fixed the errors(i also added this to the readme):