#!/usr/bin/env bash # ============================================================ # Phocinae-Largha-150M-v1 — HF push script (T-day: 2026-10-08) # ============================================================ # PREP-ONLY: this script must NOT be run before T-day, and is # executed by the release main session, not by the prep chain. # # Usage (run from this directory, i.e. hf_repo/): # HF_TOKEN=hf_xxx bash push_script.sh # # Requirements: huggingface-cli (pip install huggingface_hub), # write token for the org "Phocinae". # ------------------------------------------------------------ set -euo pipefail cd "$(dirname "$0")" # Mirror endpoint for the push; disable XET so the upload uses # the classic HTTPS path (avoiding XET-specific edge cases). export HF_ENDPOINT=https://hf-mirror.com export HF_HUB_DISABLE_XET=1 REPO="Phocinae/Phocinae-Largha-150M-v1" EXPECTED_SHA="b6472511eea30729985374f43968cf7f4b16bbe0827de6c6ca07cf92afbb778a" if [[ -z "${HF_TOKEN:-}" ]]; then echo "ERROR: HF_TOKEN is not set (Phocinae org write token required)." >&2 exit 1 fi if ! command -v huggingface-cli >/dev/null 2>&1; then echo "ERROR: huggingface-cli not found. Install with: pip install huggingface_hub" >&2 exit 1 fi # Pre-push integrity check: the weights must match the recorded sha256. ACTUAL_SHA=$(sha256sum model.safetensors | awk '{print $1}') if [[ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]]; then echo "ERROR: model.safetensors sha256 mismatch!" >&2 echo " expected: $EXPECTED_SHA" >&2 echo " actual: $ACTUAL_SHA" >&2 exit 1 fi echo "sha256 OK: $ACTUAL_SHA" echo "Pushing repo: $REPO (HF_ENDPOINT=$HF_ENDPOINT, HF_HUB_DISABLE_XET=$HF_HUB_DISABLE_XET)" huggingface-cli upload "$REPO" . --repo-type model echo "Push complete. Verify at: https://hf-mirror.com/$REPO"