1
0
This commit is contained in:
mrq 2023-02-24 13:05:08 +00:00
parent f6d0b66e10
commit 2104dbdbc5

View File

@ -843,10 +843,10 @@ def get_autoregressive_models(dir="./models/finetunes/"):
for training in os.listdir(f'./training/'): for training in os.listdir(f'./training/'):
if not os.path.isdir(f'./training/{training}/') or not os.path.isdir(f'./training/{training}/models/'): if not os.path.isdir(f'./training/{training}/') or not os.path.isdir(f'./training/{training}/models/'):
continue continue
#found = found + sorted([ f'./training/{training}/model/{d}' for d in os.listdir(f'./training/{training}/models/') if d[-8:] == "_gpt.pth" ]) #found = found + sorted([ f'./training/{training}/models/{d}' for d in os.listdir(f'./training/{training}/models/') if d[-8:] == "_gpt.pth" ])
models = sorted([ int(d[:-8]) for d in os.listdir(f'./training/{training}/models/') if d[-8:] == "_gpt.pth" ]) models = sorted([ int(d[:-8]) for d in os.listdir(f'./training/{training}/models/') if d[-8:] == "_gpt.pth" ])
found = found + [ f'./training/{training}/model/{d}_gpt.pth' for d in models ] found = found + [ f'./training/{training}/models/{d}_gpt.pth' for d in models ]
#found.append(f'./training/{training}/model/{models[-1]}_gpt.pth') #found.append(f'./training/{training}/models/{models[-1]}_gpt.pth')
return base + additionals + found return base + additionals + found
@ -1182,6 +1182,7 @@ def reload_tts( model=None ):
def update_autoregressive_model(autoregressive_model_path): def update_autoregressive_model(autoregressive_model_path):
if not autoregressive_model_path or not os.path.exists(autoregressive_model_path): if not autoregressive_model_path or not os.path.exists(autoregressive_model_path):
print(f"Invalid model: {autoregressive_model_path}")
return return
args.autoregressive_model = autoregressive_model_path args.autoregressive_model = autoregressive_model_path