Refactor: run "hatch run style:fmt"

This commit is contained in:
tsukumi
2024-09-17 05:25:29 +09:00
parent 7c5e839e82
commit a037b955ac
2 changed files with 8 additions and 3 deletions

View File

@@ -526,9 +526,10 @@ def create_inference_app(model_holder: TTSModelHolder) -> gr.Blocks:
if __name__ == "__main__": if __name__ == "__main__":
from config import get_path_config
import torch import torch
from config import get_path_config
path_config = get_path_config() path_config = get_path_config()
assets_root = path_config.assets_root assets_root = path_config.assets_root
device = "cuda" if torch.cuda.is_available() else "cpu" device = "cuda" if torch.cuda.is_available() else "cpu"

View File

@@ -204,7 +204,11 @@ if __name__ == "__main__":
if model_name: if model_name:
# load_models() の 処理内容が i の正当性を担保していることに注意 # load_models() の 処理内容が i の正当性を担保していることに注意
model_ids = [i for i, x in enumerate(model_holder.models_info) if x.name == model_name] model_ids = [
i
for i, x in enumerate(model_holder.models_info)
if x.name == model_name
]
if not model_ids: if not model_ids:
raise_validation_error( raise_validation_error(
f"model_name={model_name} not found", "model_name" f"model_name={model_name} not found", "model_name"
@@ -215,7 +219,7 @@ if __name__ == "__main__":
f"model_name={model_name} is ambiguous", "model_name" f"model_name={model_name} is ambiguous", "model_name"
) )
model_id = model_ids[0] model_id = model_ids[0]
model = loaded_models[model_id] model = loaded_models[model_id]
if speaker_name is None: if speaker_name is None:
if speaker_id not in model.id2spk.keys(): if speaker_id not in model.id2spk.keys():