HF upload
Uploads the directory given by source to the Hugging Face Hub repository
repo. Authentication uses the token secret, delivered to the CLI as
HF_TOKEN via the definition's exec.env; path_in_repo selects the
destination folder within the repository (root by default).
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
repo |
yes | — | Target repository id, namespace/name. |
repo_type |
no | model |
Repository kind: model, dataset, or space. |
source |
yes | — | Absolute path to the directory to upload inside the container (e.g. ${{env.WORKFLOW_STORAGE}}/model). |
path_in_repo |
no | repo root | Destination path inside the repository. |
token |
yes | — | Hugging Face write token (pass a project/account secret). |
Compute
CPU. Data movement only — no GPU is needed, and scheduling it on a GPU compute type wastes money.
Example
name: HF upload example
compute_type: cpu-4
entry_point: main
blocks:
main:
tasks:
publish:
name: Publish model
uses: swaleio/hf-upload
args:
repo: acme/text-classifier
repo_type: model
source: ${{env.WORKFLOW_STORAGE}}/artifacts/model
token: ${{secrets.hf_token}}
Uploads everything under ${{env.WORKFLOW_STORAGE}}/artifacts/model to the acme/text-classifier
model repository on the Hub.
For the workflow syntax these examples use, see the workflow definition reference in the Swale documentation.
Licensed under the MIT License.