Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.9.0
Hugging Face Space authentication (quick guide)
This repo can be pushed to a Hugging Face Space. Below are minimal steps to authenticate and configure your local folder so git push to the Space works.
- Install the CLI (in your venv)
pip install --upgrade huggingface_hub
# optional CLI helper
pip install --upgrade huggingface-hub[cli]
- Login interactively (recommended)
huggingface-cli login
# then paste your HF token when prompted
- Or set token in
.env(non-interactive)
Add one of these lines to your .env (already used by helper scripts):
HF_TOKEN=hf_xxx...
HUGGINGFACEHUB_API_TOKEN=hf_xxx...
- Use the helper script to configure git remote (optional)
Run in repo root (will print suggested remote and can add it):
python hf_auth_setup.py
Or manually add remote (replace <token>, <username>, <repo>):
git remote remove origin --no-optional || true
git remote add origin https://<token>@huggingface.co/spaces/<username>/<repo>.git
git push -u origin main
Note: embedding the token in the remote URL is convenient but the token will be visible in your local git config. Use huggingface-cli login or a credential helper for more secure usage.
- Space runtime Secrets
In the Hugging Face Space UI set the following Secrets (Settings → Secrets):
FB_PAGE_ACCESS_TOKENFB_PAGE_IDREPLICATE_API_TOKENOPENAI_API_KEY(if used)RUN_DAILY_REPLICATE(set totrueto enable scheduled runs)
- Troubleshooting
- If
git pushfails with 403, verify the token scope and that the token is valid. - You can create a new token at: https://huggingface.co/settings/tokens (grant
readandwriteas needed for repo creation/push).