chaofeng / deploy.sh
chaofenghui's picture
Upload folder using huggingface_hub
303079f verified
raw
history blame contribute delete
697 Bytes
#!/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"