View source: R/onnx_interface.R
| onnx_session | R Documentation |
Create a new ONNX Runtime session from a model file.
onnx_session(model_path, providers = NULL)
model_path |
Character string specifying the path to the ONNX model file |
providers |
Optional character vector specifying execution providers to use. Available providers: "cuda", "tensorrt", "directml", "onednn", "coreml", "cpu". If NULL, uses default provider priority. |
An RSession object for running inference
if (check_onnx_runtime_available()) {
# Create session with default providers
session <- onnx_example_session()
# Create session with specific providers
session <- onnx_example_session(providers = "cpu")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.