Skip to content
Latchkey

Hugging Face "RevisionNotFoundError: Revision Not Found" in CI

You pinned a revision (branch, tag, or commit) that the repo does not have, so the Hub returns 404 for that ref. Pinning is good practice, but the ref must actually exist on the repo.

What this error means

A load fails with "RevisionNotFoundError: 404 Client Error. Revision Not Found for url: https://huggingface.co/<repo>/resolve/<revision>/config.json".

huggingface_hub
huggingface_hub.utils._errors.RevisionNotFoundError: 404 Client Error.
Revision Not Found for url: https://huggingface.co/org/model/resolve/v9.9/config.json.
Available revisions: ['main', 'v1.0'].

Common causes

The pinned ref does not exist

A typo in a tag, a branch that was renamed, or a commit not on this repo yields a 404 for that revision.

The ref was removed or the repo history changed

A tag deleted or a branch force-updated can invalidate a previously working pin.

How to fix it

Pin to a ref that exists

  1. List the repo refs from the model page or the error message.
  2. Update revision to a valid branch, tag, or commit SHA.
  3. Prefer a commit SHA for immutable, reproducible pins.
python
from transformers import AutoModel
AutoModel.from_pretrained("org/model", revision="a1b2c3d4")  # a real commit SHA

Fall back to main if the tag is gone

When a tag was removed, pin to a current commit on the default branch instead.

How to prevent it

  • Pin to immutable commit SHAs rather than moving tags.
  • Verify the ref exists on the repo before pinning.
  • Watch for upstream tag deletions that break pins.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →