Skip to content

CICD-426 · Model artifact downloading ​

Encyclopedia · AI and LLM application pipelines · All snippets

Previous · CICD-425 · Next · CICD-427

1. Where it fits ​

  • Placement CI run step or authorized lab terminal.
  • Prerequisites approved synthetic evaluation data, authorized model artifacts and pinned runtime tools.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters HF_REPO, HF_REVISION.

2. Copy the snippet ​

bash
[[ "${HF_REVISION:?}" =~ ^[0-9a-f]{40}$ ]]
hf download "${HF_REPO:?}" --revision "$HF_REVISION" --local-dir model/ --include '*.safetensors' --include '*.json'

3. How it works ​

The validated revision pins the model repository snapshot. The include patterns limit files fetched, so confirm the resulting tokenizer and weights satisfy the engine contract.

4. Verify the result ​

Pin an approved model revision and obtain tokenizer assets needed by your engine. Review provenance and license before use.

Validation syntax-validated (Bash parse). Status definitions.