HCAI-Lab/w2-consensus-deepdive-unlearning-artifacts / social-data-attribution-w2 /scripts /bootstrap /with_hf_token.sh
| set -euo pipefail | |
| if [ "$#" -eq 0 ]; then | |
| echo "Usage: bash scripts/bootstrap/with_hf_token.sh <command> [args...]" >&2 | |
| exit 1 | |
| fi | |
| if [ -n "${HF_TOKEN:-}" ]; then | |
| exec "$@" | |
| fi | |
| if ! command -v op >/dev/null 2>&1; then | |
| echo "Error: HF_TOKEN not set and 1Password CLI (op) is not installed." >&2 | |
| exit 1 | |
| fi | |
| if ! op account list >/dev/null 2>&1; then | |
| echo "Error: 1Password CLI is not signed in." >&2 | |
| exit 1 | |
| fi | |
| vault="${OP_HF_VAULT:-Research}" | |
| item="${OP_HF_ITEM:-HuggingFace API}" | |
| field="${OP_HF_FIELD:-credential}" | |
| export HF_TOKEN | |
| HF_TOKEN="$(op read "op://$vault/$item/$field")" | |
| exec "$@" | |
Xet Storage Details
- Size:
- 641 Bytes
- Xet hash:
- c127cedec537541ac70fc145a79b9e1001e797579def54e6cd317afc5e976d22
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.