forked from camenduru/ai-voice-cloning
I forgot to make it update the whisper model at runtime
This commit is contained in:
parent
47058db67f
commit
5fcdb19f8b
11
src/utils.py
11
src/utils.py
|
@ -765,6 +765,17 @@ def get_dataset_list(dir="./training/"):
|
|||
def get_training_list(dir="./training/"):
|
||||
return sorted([f'./training/{d}/train.yaml' for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d)) and len(os.listdir(os.path.join(dir, d))) > 0 and "train.yaml" in os.listdir(os.path.join(dir, d)) ])
|
||||
|
||||
def update_whisper_model(name):
|
||||
global whisper_model
|
||||
if whisper_model:
|
||||
del whisper_model
|
||||
whisper_model = None
|
||||
|
||||
args.whisper_model = name
|
||||
|
||||
print(f"Loading Whisper model: {args.whisper_model}")
|
||||
whisper_model = whisper.load_model(args.whisper_model)
|
||||
|
||||
def update_autoregressive_model(path_name):
|
||||
global tts
|
||||
if not tts:
|
||||
|
|
|
@ -209,10 +209,8 @@ def history_copy_settings( voice, file ):
|
|||
return import_generate_settings( f"./results/{voice}/{file}" )
|
||||
|
||||
def update_model_settings( autoregressive_model, whisper_model ):
|
||||
if args.autoregressive_model != autoregressive_model:
|
||||
update_autoregressive_model(autoregressive_model)
|
||||
|
||||
args.whisper_model = whisper_model
|
||||
update_whisper_model(whisper_model)
|
||||
|
||||
save_args_settings()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user