huggingface auth_error ai_generated true

HTTPError: 401 Unauthorized - gated model

ID: huggingface/auth-required

Also available as: JSON · Markdown
90%Fix Rate
92%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
4 active

Root Cause

Gated model requires accepting license and token.

generic

Workarounds

  1. 95% success Accept license on HF Hub then set HF_TOKEN
    huggingface-cli login
  2. 90% success Use huggingface_hub.login() in code

Dead Ends

Common approaches that don't work:

  1. Try to download from mirror sites 88% fail

    May get tampered weights

  2. Use older ungated version 65% fail

    Missing improvements and fixes