Skip to content

Commit

Permalink
Update: モデルのロード時間を明示する
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Nov 10, 2024
1 parent 59a8a1f commit 763682d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions voicevox_engine/tts_pipeline/style_bert_vits2_tts_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(

# 音声合成に必要な BERT モデル・トークナイザーを読み込む
## 一度ロードすればプロセス内でグローバルに保持される
start_time = time.time()
logger.info("Loading BERT model and tokenizer...")
onnx_bert_models.load_model(
language=Languages.JP,
Expand All @@ -124,7 +125,7 @@ def __init__(
pretrained_model_name_or_path="tsukumijima/deberta-v2-large-japanese-char-wwm-onnx",
cache_dir=str(self.BERT_MODEL_CACHE_DIR),
)
logger.info("BERT model and tokenizer loaded.")
logger.info(f"BERT model and tokenizer loaded. ({time.time() - start_time:.2f}s)")

# load_all_models が True の場合は全ての音声合成モデルをロードしておく
if load_all_models is True:
Expand Down Expand Up @@ -208,8 +209,9 @@ def load_model(self, aivm_uuid: str) -> TTSModel:
# ONNX 推論で利用する ExecutionProvider を指定
onnx_providers=self.onnx_providers,
) # fmt: skip
start_time = time.time()
tts_model.load()
logger.info(f"{aivm_info.manifest.name} ({aivm_uuid}) loaded.")
logger.info(f"{aivm_info.manifest.name} ({aivm_uuid}) loaded. ({time.time() - start_time:.2f}s)")

self.tts_models[aivm_uuid] = tts_model
return tts_model
Expand Down

0 comments on commit 763682d

Please sign in to comment.