Add multiple style names check

This commit is contained in:
litagin02
2024-01-11 17:21:23 +09:00
parent 330d60edc6
commit 6f1707b11a

View File

@@ -211,6 +211,8 @@ def save_style_vectors_from_clustering(model_name, style_names_str: str):
return ( return (
f"スタイルの数が合いません。`,`で正しく{len(centroids)}個に区切られているか確認してください: {style_names_str}" f"スタイルの数が合いません。`,`で正しく{len(centroids)}個に区切られているか確認してください: {style_names_str}"
) )
if len(set(style_names)) != len(style_names):
return f"スタイル名が重複しています。"
shutil.copy(config_path, f"{config_path}.bak") shutil.copy(config_path, f"{config_path}.bak")
with open(config_path, "r", encoding="utf-8") as f: with open(config_path, "r", encoding="utf-8") as f: