Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

対応デバイスが分かるAPIエンドポイントを追加 #299

Merged
merged 4 commits into from
Feb 3, 2022

Conversation

takana-v
Copy link
Member

@takana-v takana-v commented Jan 24, 2022

内容

コアがCPU/GPUモードに対応しているかを返すエンドポイント/supported_devicesを追加します。

関連 Issue

close #246

その他

#254 の変更が含まれていますので、release-0.10へは含めないようにお願いします。

@github-actions
Copy link

github-actions bot commented Jan 24, 2022

Coverage Result

Resultを開く
Name Stmts Miss Cover
voicevox_engine/init.py 1 0 coverage-100%
voicevox_engine/acoustic_feature_extractor.py 75 0 coverage-100%
voicevox_engine/dev/synthesis_engine/init.py 2 0 coverage-100%
voicevox_engine/dev/synthesis_engine/mock.py 36 2 coverage-94%
voicevox_engine/full_context_label.py 167 5 coverage-97%
voicevox_engine/kana_parser.py 87 1 coverage-99%
voicevox_engine/model.py 74 7 coverage-91%
voicevox_engine/mora_list.py 4 0 coverage-100%
voicevox_engine/preset/Preset.py 12 0 coverage-100%
voicevox_engine/preset/PresetLoader.py 34 1 coverage-97%
voicevox_engine/preset/init.py 3 0 coverage-100%
voicevox_engine/synthesis_engine/init.py 5 0 coverage-100%
voicevox_engine/synthesis_engine/core_wrapper.py 148 130 coverage-12%
voicevox_engine/synthesis_engine/make_synthesis_engines.py 52 44 coverage-15%
voicevox_engine/synthesis_engine/synthesis_engine.py 108 2 coverage-98%
voicevox_engine/synthesis_engine/synthesis_engine_base.py 61 7 coverage-89%
voicevox_engine/utility/init.py 2 0 coverage-100%
voicevox_engine/utility/connect_base64_waves.py 35 3 coverage-91%
TOTAL 906 202 coverage-78%

@coveralls
Copy link

coveralls commented Jan 24, 2022

Pull Request Test Coverage Report for Build 1789403383

  • 23 of 35 (65.71%) changed or added relevant lines in 5 files are covered.
  • 31 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.4%) to 77.704%

Changes Missing Coverage Covered Lines Changed/Added Lines %
voicevox_engine/dev/synthesis_engine/mock.py 7 9 77.78%
voicevox_engine/synthesis_engine/synthesis_engine.py 6 8 75.0%
voicevox_engine/synthesis_engine/synthesis_engine_base.py 7 9 77.78%
voicevox_engine/synthesis_engine/make_synthesis_engines.py 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
voicevox_engine/synthesis_engine/synthesis_engine_base.py 1 88.52%
voicevox_engine/synthesis_engine/make_synthesis_engines.py 2 15.38%
voicevox_engine/synthesis_engine/core_wrapper.py 28 12.16%
Totals Coverage Status
Change from base Build 1740722558: -0.4%
Covered Lines: 704
Relevant Lines: 906

💛 - Coveralls

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

含めない旨了解です!

run.py Outdated
@@ -535,6 +535,18 @@ def speaker_info(speaker_uuid: str, core_version: Optional[str] = None):
ret_data = {"policy": policy, "portrait": portrait, "style_infos": style_infos}
return ret_data

@app.get("/supported_devices", response_model=List[Speaker], tags=["その他"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response_modelの値がおかしい・・・かも?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response_modelの存在を忘れていました...
とりあえず手元では{"cpu": bool, "cuda": bool}の形だったので、それに合わせて追記しました。

Copy link
Member

@PickledChair PickledChair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

気になった点についてコメントしました!

test/test_mock_synthesis_engine.py Show resolved Hide resolved
run.py Show resolved Hide resolved
@takana-v takana-v requested a review from PickledChair January 28, 2022 15:20
Copy link
Member

@PickledChair PickledChair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

test/test_mock_synthesis_engine.py Show resolved Hide resolved
@@ -160,15 +161,26 @@ def __init__(
return: 音声波形

speakers: coreから取得したspeakersに関するjsonデータの文字列

supported_devices: coreから取得した対応デバイスに関するjsonデータの文字列
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おそらくNoneのときに意味を持っている設計だと思うので、その説明があると良いのかなと思いました。
(Noneのときはすべてのデバイスでサポートしているか不明です、みたいな)

try:
supported_devices = core.supported_devices()
except NameError:
supported_devices = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytorch版にはこの関数がないのでこのエラーが出るので、何がサポートされているかわからないという意味のNoneを代入みたいな、意図のコメントがあったほうが良いかなと思いました。

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

良さそうです!!
皇族の方にわかりやすいよう、コメントとドキュメント追加をお願いしたいです・・・!

@takana-v takana-v requested a review from Hiroshiba February 3, 2022 12:36
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

対応デバイス(CPU/GPU)がわかるAPIエンドポイントを作る
4 participants