Spaces:
Running
Running
File size: 697 Bytes
303079f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/bin/bash
# 超峰海外代理 — 自动部署到 HuggingFace Space
# 用法: ./deploy.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SPACE="chaofenghui/chaofeng"
FILES=("app.py" "Dockerfile" "requirements.txt")
echo "==> 检查 hf CLI..."
if ! command -v hf &>/dev/null; then
echo "请先安装: pip install huggingface_hub --break-system-packages"
exit 1
fi
echo "==> 检查认证..."
if ! hf auth whoami &>/dev/null; then
echo "请先登录: hf auth login --token hf_你的TOKEN --add-to-git-credential"
exit 1
fi
echo "==> 上传到 $SPACE ..."
hf upload "$SPACE" "$SCRIPT_DIR" . --repo-type space
echo "==> 部署完成: https://chaofenghui-chaofeng.hf.space"
|