From 5c840ba34e4444c95195d4a6899953708178efa8 Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Thu, 12 Sep 2024 11:03:16 +0000 Subject: [PATCH] support coreml --- sbv2_core/Cargo.toml | 1 + sbv2_core/src/model.rs | 4 ++++ 2 files changed, 5 insertions(+) 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)?