Skip to content

Commit

Permalink
DeviceAvailabilitiesの表示を日本語にする
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Aug 2, 2024
1 parent 317af0f commit 6a29b20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/voicevox_core/src/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ impl Display for DeviceAvailabilities {
DeviceAvailability::NotSupportedByThisLib => {
writeln!(
f,
"* {gpu}: Not supported by this `{name}` build",
"* {gpu}: この`{name}`のビルドでは利用できません",
name = env!("CARGO_PKG_NAME"),
)
}
DeviceAvailability::NotSupportedByCurrentLoadedInferenceRuntime(name) => {
writeln!(f, "* {gpu}: Not supported by the current loaded {name}")
writeln!(f, "* {gpu}: {name}では利用できません")
}
}?;
}
Expand Down
10 changes: 9 additions & 1 deletion crates/voicevox_core/src/infer/runtimes/onnxruntime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ impl InferenceRuntime for self::blocking::Onnxruntime {
type Session = ort::Session;
type RunContext<'a> = OnnxruntimeRunContext<'a>;

const DISPLAY_NAME: &'static str = "ONNX Runtime";
const DISPLAY_NAME: &'static str = {
#[cfg(feature = "load-onnxruntime")]
{
"現在ロードされているONNX Runtime"
}

#[cfg(feature = "link-onnxruntime")]
"現在リンクされているONNX Runtime"
};

fn supported_devices(&self) -> crate::Result<SupportedDevices> {
(|| {
Expand Down

0 comments on commit 6a29b20

Please sign in to comment.