Download a single TorchScript model component
Description
Downloads a specific model component file (e.g., UNet, decoder, text encoder)
using hfhub::hub_download() from the cornball-ai dataset repos.
Usage
download_component(model_name = "sd21", component, device = "cpu",
overwrite = FALSE, show_progress = TRUE)
Arguments
model_name: Character string, the name of the model (e.g.,"sd21").component: Character string, the component to download (e.g.,"unet","decoder").device: Character string, the device type (e.g.,"cpu"or"cuda").overwrite: Logical; ifTRUE, force re-download even if cached.show_progress: Logical; ifTRUE(default), displays progress during download.
Value
The local file path to the downloaded component (character string).
Examples
path <- download_component("sd21", "text_encoder", "cpu")