Spaces:
Build error
Build error
I forgot to make it update the whisper model at runtime
Browse files- src/utils.py +11 -0
- src/webui.py +2 -4
src/utils.py
CHANGED
|
@@ -765,6 +765,17 @@ def get_dataset_list(dir="./training/"):
|
|
| 765 |
def get_training_list(dir="./training/"):
|
| 766 |
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)) ])
|
| 767 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 768 |
def update_autoregressive_model(path_name):
|
| 769 |
global tts
|
| 770 |
if not tts:
|
|
|
|
| 765 |
def get_training_list(dir="./training/"):
|
| 766 |
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)) ])
|
| 767 |
|
| 768 |
+
def update_whisper_model(name):
|
| 769 |
+
global whisper_model
|
| 770 |
+
if whisper_model:
|
| 771 |
+
del whisper_model
|
| 772 |
+
whisper_model = None
|
| 773 |
+
|
| 774 |
+
args.whisper_model = name
|
| 775 |
+
|
| 776 |
+
print(f"Loading Whisper model: {args.whisper_model}")
|
| 777 |
+
whisper_model = whisper.load_model(args.whisper_model)
|
| 778 |
+
|
| 779 |
def update_autoregressive_model(path_name):
|
| 780 |
global tts
|
| 781 |
if not tts:
|
src/webui.py
CHANGED
|
@@ -209,10 +209,8 @@ def history_copy_settings( voice, file ):
|
|
| 209 |
return import_generate_settings( f"./results/{voice}/{file}" )
|
| 210 |
|
| 211 |
def update_model_settings( autoregressive_model, whisper_model ):
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
args.whisper_model = whisper_model
|
| 216 |
|
| 217 |
save_args_settings()
|
| 218 |
|
|
|
|
| 209 |
return import_generate_settings( f"./results/{voice}/{file}" )
|
| 210 |
|
| 211 |
def update_model_settings( autoregressive_model, whisper_model ):
|
| 212 |
+
update_autoregressive_model(autoregressive_model)
|
| 213 |
+
update_whisper_model(whisper_model)
|
|
|
|
|
|
|
| 214 |
|
| 215 |
save_args_settings()
|
| 216 |
|