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

docs: #902 の注意書き #903

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/voicevox_core/src/nonblocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
//! スレッドプールのサイズは、blockingクレートの説明にある通り`$BLOCKING_MAX_THREADS`で調整すること
//! ができる。
//!
//! また未調査ではあるが、[`cpu_num_threads`]を`0`にするのは適切ではない可能性がある ([VOICEVOX/voicevox_core#902])。
//!
//! [blocking]: https://docs.rs/crate/blocking
//! [pollster]: https://docs.rs/crate/pollster
//! [VOICEVOX/voicevox_core#902]: https://github.com/VOICEVOX/voicevox_core/issues/902
//! [`cpu_num_threads`]: crate::InitializeOptions::cpu_num_threads
pub use crate::{
engine::open_jtalk::nonblocking::OpenJtalk,
Expand Down
9 changes: 9 additions & 0 deletions crates/voicevox_core/src/synthesizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ pub enum AccelerationMode {
#[derive(Default)]
pub struct InitializeOptions {
pub acceleration_mode: AccelerationMode,

/// CPU利用数を指定。0を指定すると環境に合わせたCPUが利用される。
///
/// # Performance
///
/// 未調査ではあるが、[非同期版API]においては`0`にするのは適切ではない可能性がある ([VOICEVOX/voicevox_core#902])。
///
/// [非同期版API]: crate::nonblocking
/// [VOICEVOX/voicevox_core#902]: https://github.com/VOICEVOX/voicevox_core/issues/902
pub cpu_num_threads: u16,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class Synthesizer:
acceleration_mode
ハードウェアアクセラレーションモード。
cpu_num_threads
CPU利用数を指定。0を指定すると環境に合わせたCPUが利用される。
CPU利用数を指定。0を指定すると環境に合わせたCPUが利用される。未調査ではあるが、 ``0`` にするのは適切ではない可能性がある
(`VOICEVOX/voicevox_core#902 <https://github.com/VOICEVOX/voicevox_core/issues/902>`_)。
"""

def __init__(
Expand Down
11 changes: 11 additions & 0 deletions crates/voicevox_core_python_api/python/voicevox_core/asyncio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# TODO: Rust API同様に、`$BLOCKING_MAX_THREADS`について言及
"""
非同期API。
Performance
-----------
未調査ではあるが、 ``cpu_num_threads`` に ``0`` にするのは適切ではない可能性がある
(`VOICEVOX/voicevox_core#902 <https://github.com/VOICEVOX/voicevox_core/issues/902>`_)。
"""

# pyright: reportMissingModuleSource=false
from ._rust.asyncio import Onnxruntime, OpenJtalk, Synthesizer, UserDict, VoiceModelFile

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# TODO: Rust API同様のmodule levelのdocstringを書く

# pyright: reportMissingModuleSource=false
from ._rust.blocking import (
AudioFeature,
Expand Down
Loading