|
Download scripts/upload.md from Holmes2011/ZeroPoint: direct link, hf CLI and curl.
- Browser
- Download file 3.29 kB
-
https://huggingface.co/Holmes2011/ZeroPoint/resolve/main/scripts/upload.md
- Command line
-
hf download hf://Holmes2011/ZeroPoint/scripts/upload.md
-
curl -L -o upload.md https://huggingface.co/Holmes2011/ZeroPoint/resolve/main/scripts/upload.md
3.29 kB
| # Publishing ZeroPoint to the Hugging Face Hub | |
| This note records the exact steps used to publish this release tree as a **public** model | |
| repository. It is for the maintainer performing the upload; users of the release do not | |
| need it. Never commit a real access token, and never print one in a terminal that records | |
| its output. | |
| The commands below were checked against `huggingface_hub` 1.27.0 (`hf` CLI). | |
| ## 0. Environment: the local proxy is mandatory here | |
| In this environment `huggingface.co` is only reachable through the local HTTP proxy at | |
| `http://127.0.0.1:7897`. Set both proxy variables in every shell that talks to the Hub, | |
| and pin the official endpoint: | |
| ```bash | |
| export HTTPS_PROXY=http://127.0.0.1:7897 | |
| export HTTP_PROXY=http://127.0.0.1:7897 | |
| export HF_ENDPOINT=https://huggingface.co | |
| ``` | |
| If the proxy is not running on port 7897, the commands below hang and then fail with a | |
| connection or SSL error — start the proxy first. Do not leave a mirror or an offline | |
| `HF_ENDPOINT` in the environment. | |
| ## 1. Authenticate (token required) | |
| Create a **write** token at <https://huggingface.co/settings/tokens>. Then either log in | |
| interactively (the token is not echoed): | |
| ```bash | |
| hf auth login | |
| ``` | |
| or pass the token from an environment variable, without ever writing it to a file: | |
| ```bash | |
| read -rs HF_TOKEN && export HF_TOKEN # paste at the prompt; input is hidden | |
| hf auth login --token "$HF_TOKEN" | |
| ``` | |
| `hf auth login --token "$HF_TOKEN"` stores the token in the local Hugging Face config | |
| (`~/.cache/huggingface/`), so the later commands pick it up automatically. Verify: | |
| ```bash | |
| hf auth whoami | |
| ``` | |
| ## 2. Create the public model repository | |
| ```bash | |
| hf repos create <your-username>/ZeroPoint --type model --public | |
| ``` | |
| Replace `<your-username>` with the account (or organization) that owns the release. If the | |
| repository already exists, skip this step and make sure its visibility is public in the | |
| repository settings. | |
| ## 3. Upload the release tree | |
| Upload the **contents** of `repo/` so that `README.md`, `LICENSE`, `docs/`, `models/`, | |
| `experiments/`, `tests/`, etc. land at the repository root: | |
| ```bash | |
| cd "<release-root>" # the directory containing README.md, LICENSE, models/, docs/ (i.e. the parent of this scripts/ folder) | |
| hf upload <your-username>/ZeroPoint . --type model \ | |
| --commit-message "ZeroPoint v0 research prototype: architecture, ZeroCG framework, comparison experiments" | |
| ``` | |
| This is a single-commit upload of the whole tree. It includes | |
| `tests/golden/zeropoint_ref.json` (the fixed reference data required by the self-checks) | |
| and must not include model weights, training runs, corpora, or tokens — see | |
| `.gitignore`; the release tree itself contains none of those. | |
| If the upload is interrupted, re-run the same command: files already uploaded are skipped | |
| and the commit is retried. | |
| ## 4. Verify the published repository | |
| ```bash | |
| hf repos ls | |
| hf auth whoami | |
| # Confirm the public API view, through the proxy: | |
| curl -sS --proxy http://127.0.0.1:7897 \ | |
| "https://huggingface.co/api/models/<your-username>/ZeroPoint" | head -c 2000 | |
| ``` | |
| Then open <https://huggingface.co/<your-username>/ZeroPoint> in a browser and confirm | |
| that `README.md`, `LICENSE`, `docs/ZeroPoint.md`, `docs/ZeroPoint_EN.md`, and the | |
| `tests/golden/` file are all present. | |