load_n3d: Load the Diarization Model

View source: R/model.R

load_n3dR Documentation

Load the Diarization Model

Description

Builds the network and loads the Nemotron 3 Diarization weights from the Hugging Face cache.

Usage

load_n3d(
  device = default_device(),
  download = FALSE,
  revision = n3d_revision()
)

Arguments

device

Torch device, "cuda" when available, otherwise "cpu".

download

Whether to download the weights when they are not cached. Defaults to FALSE; see download_n3d.

revision

Hugging Face commit to load. Defaults to the commit this package was validated against.

Details

On CUDA each encoder layer runs as a traced TorchScript graph, which frees intermediate tensors as it goes (peak device memory about 0.45 GiB instead of about 2 GiB) and removes most per-operation R overhead. Tracing and warming it up take about a second, once per model. Set options(n3d.jit = FALSE) to run the plain R functions instead. The CPU always runs them.

Value

An n3d_model object: a list holding the network and its configuration.

Examples


if (n3d_exists()) {
  model <- load_n3d(device = "cpu")
}


n3d documentation built on Oct. 14, 2026, 5:08 p.m.