install_runtime() downloads and installs ONNX Runtime, the native inference
library on which transformer models run, through onnxr::onnx_install(): the
portable CPU build, a CUDA build where supported, or the build chosen by
automatic detection. The CRAN package onnxr provides the R interface but
leaves the library itself, a large platform-specific binary that is not part
of R, to be installed on request.
Nothing is installed when the package is installed or loaded; this function
is the only path. Run it once per R library before load_model() or
load_custom(). The static potion-base-8M model does not need it. Model
files are installed separately with model_download().
Arguments
- cuda
FALSEfor the CPU runtime,TRUEto request CUDA on supported systems, orNULL(default) for automatic detection; passed toonnxr::onnx_install().
Value
The value of onnxr::onnx_install(), invisibly.
See also
load_model(), which needs the runtime; model_download() for
the model files; onnxr::onnx_is_installed() to check the installation.
Examples
# Whether the ONNX Runtime is already available; nothing is installed here.
onnxr::onnx_is_installed()
#> [1] FALSE
# \donttest{
if (interactive()) {
install_runtime()
}
# }
