Docs /Templates/ sinapsis-huggingface-hub

HuggingFaceDownloader

sinapsis-huggingface-hubHugging Face Hubhuggingfacemodels

Python template · sinapsis_huggingface_hub.templates.huggingface_downloader

Overview

A Sinapsis Template that downloads a repository snapshot from the Hugging Face Hub.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-huggingface-hub==1.0.0
uv pip install sinapsis-huggingface-hub==1.0.0
uv add sinapsis-huggingface-hub==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

proxies

A dictionary of proxy servers to use for the download.

dict
Optional
Default: null
repo_idRequired

The repository ID from the Hub (e.g., "stabilityai/stable-diffusion-2-1").

str
Required
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
revision

The specific model version to use (e.g., a branch name, tag, or commit hash).

str | None
Optional
Default: null
cache_dir

The directory where downloaded files will be cached.

str
Optional
Default: "/home/ariel/.cache/sinapsis"
repo_type

The type of the repository.

typing.Literal['dataset', 'space', 'model']
Optional
Default: "model"
max_workers

The maximum number of threads to use for parallel downloads.

int
Optional
Default: 8
etag_timeout

The timeout in seconds for checking the ETag of the files.

float
Optional
Default: 10
allow_patterns

A pattern or list of patterns to specify which files to download.

list[str] | str | None
Optional
Default: null
force_download

If True, forces the repository to be re-downloaded even if it's already cached.

bool
Optional
Default: false
ignore_patterns

A pattern or list of patterns to specify which files to ignore.

list[str] | str | None
Optional
Default: null
resume_download

If True, resumes an interrupted download.

bool
Optional
Default: false
local_files_only

If True, the function will only look for the files in the cache and will not access the network.

bool
Optional
Default: false

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "HuggingFaceDownloader"
    class_name: "HuggingFaceDownloader"
    attributes:
      proxies: {}
      repo_id: "<required>"
      revision: null
      cache_dir: "/home/ariel/.cache/sinapsis"
      repo_type: "model"
      max_workers: 8
      etag_timeout: 10
      allow_patterns: null
      force_download: false
      ignore_patterns: null
      resume_download: false
      local_files_only: false

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_CACHE_DIR · defined elsewhere