Skip to content

Commit

Permalink
整理: CoreSpeaker の強制 Speaker 化を削除 (#1365)
Browse files Browse the repository at this point in the history
refactor: metas の部分的 speaker 化を削除
  • Loading branch information
tarepan authored Jun 18, 2024
1 parent e3d49cc commit c72b889
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions voicevox_engine/app/routers/speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Literal

from fastapi import APIRouter, HTTPException
from pydantic import TypeAdapter
from pydantic.json_schema import SkipJsonSchema

from voicevox_engine.core.core_initializer import CoreManager
Expand Down Expand Up @@ -46,8 +45,6 @@ def speaker_info(
core_version=core_version,
)

_speaker_list_adapter = TypeAdapter(list[Speaker])

# FIXME: この関数をどこかに切り出す
def _speaker_info(
speaker_uuid: str,
Expand Down Expand Up @@ -78,9 +75,8 @@ def _speaker_info(
# ...

# 該当話者を検索する
speakers = _speaker_list_adapter.validate_python(
core_manager.get_core(core_version).speakers, from_attributes=True
)
core_speakers = core_manager.get_core(core_version).speakers
speakers = metas_store.load_combined_metas(core_speakers)
speakers = filter_speakers_and_styles(speakers, speaker_or_singer)
speaker = next(
filter(lambda spk: spk.speaker_uuid == speaker_uuid, speakers), None
Expand Down

0 comments on commit c72b889

Please sign in to comment.