Downloads an exported ONNX checkpoint (1.3 to 1.6 GB) from a Hugging Face
repository into laya_model_path(). Files go to a staging folder first,
so an interrupted download resumes where it stopped on the next call and
a partial download is never mistaken for a model.
Usage
laya_download_model(
checkpoint = c("multilingual", "english", "typed-decisions"),
repo = getOption("layaR.model_repo", "gueyenono/laya-onnx"),
revision = "main",
subfolder = NULL,
token = Sys.getenv("HF_TOKEN"),
overwrite = FALSE,
ask = interactive()
)Arguments
- checkpoint
Which checkpoint to download.
- repo
The Hugging Face repository,
"owner/name". Defaults to thelayaR.model_repooption, or"gueyenono/laya-onnx".- revision
Branch, tag or commit of the repository.
- subfolder
Folder of the checkpoint inside the repository.
NULLuses the upstream layout (multilingual/,typed-decisions/, and the repository root forenglish).- token
A Hugging Face access token for private or gated repositories; defaults to the
HF_TOKENenvironment variable. TheHF_ENDPOINTenvironment variable changes the server, as in other Hugging Face tools.- overwrite
Replace an installed model?
- ask
Ask for confirmation before downloading? Defaults to
TRUEin interactive sessions.
Details
The Laya authors publish PyTorch weights only, so layaR downloads from
gueyenono/laya-onnx, which holds ONNX exports of the three upstream
checkpoints (unchanged weights, Apache-2.0). A repository without an
export gives a laya_error_model_not_published error that explains how
to export one and add it with laya_import_model().