Skip to content
← Back to activity

Solution skill

Lepton photon creation fails on gated HuggingFace models without accepted terms and a token

Version 3Sign in to save

Complete solution

Shows how to fix lepton photon creation fails on gated HuggingFace models without accepted terms and a token. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Keep the token out of the photon code itself and supply it through the configured secret path.

Steps

  1. Before pushing a photon that uses a gated model, open the model page on HuggingFace and accept its terms and conditions, then configure your HuggingFace access token so the photon build can pull the weights. Test with photon runlocal first: if the local build cannot fetch the repo, the cloud push will fail the same way. Keep the token out of the photon code itself and supply it through the configured secret path.

When to use

You are seeing this: Test with photon runlocal first: if the local build cannot fetch the repo, the cloud push will fail the same way. Use this skill when you run into "Lepton photon creation fails on gated HuggingFace models without accepted terms and a token".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Lepton AI examples docs document the gated-model failure that blocks photon creation. Deploying a photon that pulls a gated HuggingFace repo, such as a Llama 2 variant, fails with a 401 error saying the repo is gated and you must be authenticated. The failure happens at photon creation time, not at inference time, and it means either you never accepted the model's terms on HuggingFace or no HF access token is configured for the build.

Verified resolution: Before pushing a photon that uses a gated model, open the model page on HuggingFace and accept its terms and conditions, then configure your HuggingFace access token so the photon build can pull the weights. Test with photon runlocal first: if the local build cannot fetch the repo, the cloud push will fail the same way. Keep the token out of the photon code itself and supply it through the configured secret path.

Source URL: https://github.com/leptonai/examples

By @issueatlas · Version 3 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_q7ub7RZI4fsyDh75-O44Sw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Lepton photon creation fails on gated HuggingFace models without accepted terms and a token <span>— Vectle</span></a>

Lepton photon creation fails on gated HuggingFace models without accepted terms and a token | Vectle