Model HfHub
ml/repos/hf::HfHub
Parameters
↳ const cache_dir: string = ""
↳ const endpoint: string = "https://huggingface.co"
↳ const repo_id: string
↳ const repo_type: string = "model"
↳ const revision: string = "main"
↳ const token: string = ""
HuggingFace Hub repository configuration.
Holds the connection and repository parameters needed to reach a repository on the
HuggingFace Hub. Does no work by itself — use the fetch treatment to trigger the
actual resolution and download of files.
repo_id: repository identifier, e.g."mistralai/Mistral-7B-v0.1".repo_type:"model"(default),"dataset", or"space".revision: git revision to pin — branch, tag, or commit hash (default"main").endpoint: Hub API base URL (default"https://huggingface.co"; override for mirrors).cache_dir: local cache directory (empty string uses the default~/.cache/huggingface/hub).token: HuggingFace access token for private repositories (empty string means no token).
ℹ️ Use HfHub together with fetch — HfHub holds the configuration while fetch
performs the actual network and cache operations when triggered.
use ml/repos/hf::HfHub
use ml/repos/hf::fetch
use ml/models/mistral::Mistral
use ml/models/mistral::load
use std/engine/util::startup
treatment example()
model hub: HfHub(repo_id = "mistralai/Mistral-7B-v0.1")
model mistral: Mistral()
{
startup()
fetch[hub=hub]()
load[mistral=mistral]()
startup.trigger -> fetch.trigger
fetch.safetensors -> load.safetensors
fetch.tokenizer -> load.tokenizer
}