powered by
Downloads files from HuggingFace repositories
hub_download( repo_id, filename, ..., revision = "main", repo_type = "model", local_files_only = FALSE, force_download = FALSE )
The file path of the downloaded or cached file. The snapshot path is returned as an attribute.
The repository identifier, eg "bert-base-uncased" or "deepset/sentence_bert".
"bert-base-uncased"
"deepset/sentence_bert"
Filename to download from the repository. Example "config.json".
"config.json"
currenytly unused.
Revision (branch, tag or commitid) to download the file from.
The type of the repository. Currently only "model" is supported.
"model"
Only use cached files?
For re-downloading of files that are cached.
try({ withr::with_envvar(c(HUGGINGFACE_HUB_CACHE = tempdir()), { path <- hub_download("gpt2", "config.json") print(path) str(jsonlite::fromJSON(path)) }) })
Run the code above in your browser using DataLab