Download deploy.sh from idiouf/African-Books-Recovery-Project: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/idiouf/African-Books-Recovery-Project/resolve/main/deploy.sh
- Command line
-
hf download hf://spaces/idiouf/African-Books-Recovery-Project/deploy.sh
-
curl -L -o deploy.sh https://huggingface.co/spaces/idiouf/African-Books-Recovery-Project/resolve/main/deploy.sh
1.43 kB
| # Push this directory to a Hugging Face Space (static SDK, index.html). | |
| # | |
| # 1. Create the Space first (Static SDK, blank template): | |
| # https://huggingface.co/new-space | |
| # 2. export HF_TOKEN=hf_... (a token with write access) | |
| # 3. ./deploy.sh <your-username>/African-Books-Recovery-Project | |
| # | |
| # Alternatives that need no token: drag this whole folder into the Space's | |
| # "Files" tab in the browser, or push it as a git repo: | |
| # git init && git remote add origin https://huggingface.co/spaces/<user>/<space> | |
| # git add . && git commit -m "initial" && git push -u origin main | |
| set -euo pipefail | |
| REPO="${1:-idiouf/African-Books-Recovery-Project}" | |
| : "${HF_TOKEN:?export HF_TOKEN first}" | |
| HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| python -m pip install --quiet --upgrade huggingface_hub | |
| REPO="$REPO" FOLDER="$HERE" python - <<'PY' | |
| import os | |
| from huggingface_hub import HfApi | |
| repo = os.environ["REPO"] | |
| api = HfApi(token=os.environ["HF_TOKEN"]) | |
| api.create_repo(repo_id=repo, repo_type="space", space_sdk="static", exist_ok=True) | |
| api.upload_folder( | |
| repo_id=repo, | |
| repo_type="space", | |
| folder_path=os.environ["FOLDER"], | |
| ignore_patterns=["__pycache__/*", "*.pyc", ".git/*", ".venv/*", "email-*", "ABRP_West_Africa_*"], | |
| commit_message="African Books Recovery Project - static dashboard, ETL and sourced research data", | |
| ) | |
| print("\nhttps://huggingface.co/spaces/" + repo) | |
| PY | |