Skip to content

Commit

Permalink
Add: ロード時にログを出す
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Oct 12, 2024
1 parent db8e0b5 commit 11c57fe
Show file tree
Hide file tree
Showing 7 changed files with 404 additions and 345 deletions.
2 changes: 1 addition & 1 deletion crates/voicevox_core/src/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub(crate) trait InferenceDomain: Sized {
/// それぞれのバリアントには、対応する`InferenceSignature`が存在するべきである。
///
/// `::macros::InferenceOperation`により導出される。
pub(crate) trait InferenceOperation: Copy + Enum {
pub(crate) trait InferenceOperation: Copy + Enum + Debug {
/// `{InferenceInputSignature,InferenceOutputSignature}::PARAM_INFOS`を集めたもの。
#[expect(
clippy::type_complexity,
Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/src/infer/domains/talk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl InferenceDomain for TalkDomain {
}
}

#[derive(Clone, Copy, Enum, InferenceOperation)]
#[derive(Clone, Copy, Enum, Debug, InferenceOperation)]
#[inference_operation(
type Domain = TalkDomain;
)]
Expand Down
5 changes: 5 additions & 0 deletions crates/voicevox_core/src/infer/session_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{collections::HashMap, fmt::Display, marker::PhantomData, sync::Arc};

use enum_map::{Enum as _, EnumMap};
use itertools::Itertools as _;
use tracing::info;

use crate::error::ErrorRepr;

Expand All @@ -26,6 +27,10 @@ impl<R: InferenceRuntime, D: InferenceDomain> InferenceSessionSet<R, D> {
let (expected_input_param_infos, expected_output_param_infos) =
<D::Operation as InferenceOperation>::PARAM_INFOS[op];

info!(
"Loading model for operation {:?} with options {:?}",
op, options[op]
);
let (sess, actual_input_param_infos, actual_output_param_infos) =
rt.new_session(|| model_file::decrypt(model_bytes), options[op])?;

Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/wasm_library.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ addToLibrary({
if (!session) {
console.log("onnxruntime session create with WASM");
session = await onnxruntime.InferenceSession.create(modelData, {
executionProviders: ["wasm"],
executionProviders: ["cpu"],
});
}
sessions[nonce] = session;
Expand Down
14 changes: 7 additions & 7 deletions example/wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"dependencies": {
"jszip": "3.10.1",
"onnxruntime-web": "^1.19.2",
"vue": "^3.3.8"
"vue": "^3.5.12"
},
"devDependencies": {
"@types/emscripten": "^1.39.10",
"@types/node": "^18.18.13",
"@vitejs/plugin-vue": "^4.5.0",
"typescript": "^5.2.2",
"vite": "^5.0.0",
"vue-tsc": "^1.8.22"
"@types/emscripten": "^1.39.13",
"@types/node": "^22.7.5",
"@vitejs/plugin-vue": "^5.1.4",
"typescript": "^5.6.3",
"vite": "^5.4.8",
"vue-tsc": "^2.1.6"
}
}
Loading

0 comments on commit 11c57fe

Please sign in to comment.