Skip to content

Commit

Permalink
version up onnxruntime-rs to 0.0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty2501 committed May 18, 2022
1 parent 3c8b004 commit a53b00b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cfg-if = "1.0.0"
derive-getters = "0.2.0"
derive-new = "0.5.9"
once_cell = "1.10.0"
onnxruntime = { git = "https://github.com/qwerty2501/onnxruntime-rs.git", version = "0.0.16" }
onnxruntime = { git = "https://github.com/qwerty2501/onnxruntime-rs.git", version = "0.0.17" }
thiserror = "1.0.31"

[dev-dependencies]
Expand Down
16 changes: 8 additions & 8 deletions crates/voicevox_core/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ cfg_if! {
}
}
use std::collections::BTreeMap;
use std::sync::Mutex;

pub struct Status {
models: Mutex<StatusModels>,
models: StatusModels,
session_options: SessionOptions,
}

Expand Down Expand Up @@ -110,11 +109,11 @@ impl Status {

pub fn new(use_gpu: bool, cpu_num_threads: usize) -> Self {
Self {
models: Mutex::new(StatusModels {
models: StatusModels {
yukarin_s: BTreeMap::new(),
yukarin_sa: BTreeMap::new(),
decode: BTreeMap::new(),
}),
},
session_options: SessionOptions::new(cpu_num_threads, use_gpu),
}
}
Expand All @@ -131,11 +130,12 @@ impl Status {
.new_session(model.decode_model)
.map_err(Error::LoadModel)?;

let mut models = self.models.lock().unwrap();
models.yukarin_s.insert(model_index, yukarin_s_session);
models.yukarin_sa.insert(model_index, yukarin_sa_session);
self.models.yukarin_s.insert(model_index, yukarin_s_session);
self.models
.yukarin_sa
.insert(model_index, yukarin_sa_session);

models.decode.insert(model_index, decode_model);
self.models.decode.insert(model_index, decode_model);

Ok(())
}
Expand Down

0 comments on commit a53b00b

Please sign in to comment.