Skip to content

Commit

Permalink
整理: FastAPI を API 関連に限局 (#1372)
Browse files Browse the repository at this point in the history
* delete: 過剰なロギングを削除

* add: `WordTypes` docstring を外部向けへ変更
  • Loading branch information
tarepan authored Jun 2, 2024
1 parent 25bb386 commit 7cadd4d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions voicevox_engine/dev/tts_engine/mock.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""TTSEngine のモック"""

import copy
from logging import getLogger
from typing import Any

import numpy as np
Expand Down Expand Up @@ -67,9 +66,7 @@ def forward(self, text: str, **kwargs: dict[str, Any]) -> NDArray[np.float32]:
# resampleの説明
非モック実装(decode_forward)と合わせるために、出力を24kHz、32bit浮動小数に変換した。
"""
logger = getLogger("uvicorn") # FastAPI / Uvicorn 内からの利用のため
logger.info("[Mock] input text: %s" % text)
wave, sr = tts(text)
wave, _ = tts(text)
wave /= 2**15
wave_resampled: NDArray[np.float64] = resample(wave, 48000, 24000)
return wave_resampled.astype(np.float32)
4 changes: 1 addition & 3 deletions voicevox_engine/user_dict/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@


class WordTypes(str, Enum):
"""
fastapiでword_type引数を検証する時に使用するクラス
"""
"""品詞"""

PROPER_NOUN = "PROPER_NOUN"
COMMON_NOUN = "COMMON_NOUN"
Expand Down

0 comments on commit 7cadd4d

Please sign in to comment.