-
Notifications
You must be signed in to change notification settings - Fork 204
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
Conversation
Pull Request Test Coverage Report for Build 1789403383
💛 - Coveralls |
There was a problem hiding this 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=["その他"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response_model
の値がおかしい・・・かも?
There was a problem hiding this comment.
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}
の形だったので、それに合わせて追記しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
気になった点についてコメントしました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -160,15 +161,26 @@ def __init__( | |||
return: 音声波形 | |||
|
|||
speakers: coreから取得したspeakersに関するjsonデータの文字列 | |||
|
|||
supported_devices: coreから取得した対応デバイスに関するjsonデータの文字列 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytorch版にはこの関数がないのでこのエラーが出るので、何がサポートされているかわからないという意味のNoneを代入みたいな、意図のコメントがあったほうが良いかなと思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
良さそうです!!
皇族の方にわかりやすいよう、コメントとドキュメント追加をお願いしたいです・・・!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
内容
コアがCPU/GPUモードに対応しているかを返すエンドポイント
/supported_devices
を追加します。関連 Issue
close #246
その他
#254 の変更が含まれていますので、release-0.10へは含めないようにお願いします。