support coreml

This commit is contained in:
tuna2134
2024-09-12 11:03:16 +00:00
parent e9befcb346
commit 5c840ba34e
2 changed files with 5 additions and 0 deletions

View File

@@ -31,3 +31,4 @@ cuda_tf32 = []
dynamic = ["ort/load-dynamic"]
directml = ["ort/directml"]
tensorrt = ["ort/tensorrt"]
coreml = ["ort/coreml"]

View File

@@ -35,6 +35,10 @@ pub fn load_model<P: AsRef<[u8]>>(model_file: P, bert: bool) -> Result<Session>
{
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)?