-
Notifications
You must be signed in to change notification settings - Fork 196
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
run.py: __main__
実装をmain
関数スコープに移動させる
#761
Merged
Hiroshiba
merged 4 commits into
VOICEVOX:master
from
aoirint:patch-main_script_function_scope
Oct 9, 2023
Merged
run.py: __main__
実装をmain
関数スコープに移動させる
#761
Hiroshiba
merged 4 commits into
VOICEVOX:master
from
aoirint:patch-main_script_function_scope
Oct 9, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aoirint
changed the title
run.py:
run.py: Oct 9, 2023
__main__
実装をmain関数スコープに移動させる__main__
実装をmain
関数スコープに移動させる
Hiroshiba
approved these changes
Oct 9, 2023
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!!
思っていたよりずっと分離できていたんだな〜と感じました!すごい。
takana-v
pushed a commit
to voicevox-bridge/bridge-plugin
that referenced
this pull request
Nov 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
内容
run.py
の__main__
実装を関数スコープにしたい #752の実装です。
run.py
のif __name__ == "__main__":
以下の実装を、新しく追加したmain
関数に移動させます。generate_app
関数内でグローバルスコープ変数(run.py
のファイルスコープ変数)を参照することを防ぎ、run.py
以外のテストなどからgenerate_app
が呼び出された際の不具合を防ぎます。関連 Issue
run.py
の__main__
実装を関数スコープにしたい #752スクリーンショット・動画など
その他
default_cors_policy_mode
変数の削除についてもともと未使用変数だったため削除しました。引数
--cors_policy_mode
が指定されなかった場合、リポジトリのdefault_setting.yml
に記述されたlocalapps
が使用されます。generate_app
関数内のenable_cancellable_synthesis
判定についてgenerate_app
関数にenable_cancellable_synthesis: bool
引数を追加する代わりに、cancellable_engine: CancellableEngine | None
引数を追加して、is not None
で判定するようにしました。Cancellable Engineを有効化するコマンド例(Windows)
poetry run python run.py --voicevox_dir "$HOME/AppData/Local/Programs/VOICEVOX" --enable_cancellable_synthesis --init_processes 2