Skip to content

cran/hfhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hfhub

R-CMD-check

hfhub is a minimal port of huggingface_hub that allows downloading files from Hugging Face Hub and caching them with the same structure used in the original implementation.

Installation

hfhub can be installed from CRAN with:

install.packages("hfhub")

You can install the development version of hfhub like so:

remotes::install_github("mlverse/hfhub")

Example

hub_download the the only exported function in the package and can be used to download and cache a file from any Hugging Face Hub repository. It returns a path to the file.

library(hfhub)
path <- hub_download("gpt2", "config.json")
str(jsonlite::fromJSON(path))

Authentication

You can set the HUGGING_FACE_HUB_TOKEN environment variable with the value of a token obtained in the Access Token section of the Hugging Face account setting page. This will allow you to download private files from Hugging Face Hub.

About

❗ This is a read-only mirror of the CRAN R package repository. hfhub — Hugging Face Hub Interface. Homepage: https://mlverse.github.io/hfhub/

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages