diff --git a/sbv2_api/Cargo.toml b/sbv2_api/Cargo.toml index a0fa8b6..4b0b43a 100644 --- a/sbv2_api/Cargo.toml +++ b/sbv2_api/Cargo.toml @@ -14,6 +14,7 @@ serde = { version = "1.0.210", features = ["derive"] } tokio = { version = "1.40.0", features = ["full"] } [features] +coreml = ["sbv2_core/coreml"] cuda = ["sbv2_core/cuda"] cuda_tf32 = ["sbv2_core/cuda_tf32"] dynamic = ["sbv2_core/dynamic"] diff --git a/sbv2_api/src/main.rs b/sbv2_api/src/main.rs index f9cd22d..a10ec0a 100644 --- a/sbv2_api/src/main.rs +++ b/sbv2_api/src/main.rs @@ -99,7 +99,7 @@ impl AppState { continue; } }; - if let Err(e) = tts_model.load_sbv2file(&entry, sbv2_bytes) { + if let Err(e) = tts_model.load_sbv2file(entry, sbv2_bytes) { log::warn!("Error loading {entry}: {e}"); }; log::info!("Loaded: {entry}"); diff --git a/sbv2_core/Cargo.toml b/sbv2_core/Cargo.toml index 0a8a88c..63badb6 100644 --- a/sbv2_core/Cargo.toml +++ b/sbv2_core/Cargo.toml @@ -31,3 +31,4 @@ cuda_tf32 = [] dynamic = ["ort/load-dynamic"] directml = ["ort/directml"] tensorrt = ["ort/tensorrt"] +coreml = ["ort/coreml"] \ No newline at end of file diff --git a/sbv2_core/src/model.rs b/sbv2_core/src/model.rs index 2fa75c3..2b975ca 100644 --- a/sbv2_core/src/model.rs +++ b/sbv2_core/src/model.rs @@ -35,6 +35,10 @@ pub fn load_model>(model_file: P, bert: bool) -> Result { exp.push(ort::DirectMLExecutionProvider::default().build()); } + #[cfg(feature = "coreml")] + { + exp.push(ort::CoreMLExecutionProvider::default().build()); + } exp.push(ort::CPUExecutionProvider::default().build()); Ok(Session::builder()? .with_execution_providers(exp)?