File size: 1,283 Bytes
add24bd
 
 
 
 
 
 
 
5673379
add24bd
 
 
 
 
 
 
 
5673379
add24bd
5673379
add24bd
 
 
 
 
 
 
 
 
 
 
 
5673379
add24bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Push hf_prebackbone_demo to https://huggingface.co/spaces/vinayedula/RefDiffNet
set -euo pipefail
cd "$(dirname "$0")"

SPACE_REMOTE="${SPACE_REMOTE:-https://huggingface.co/spaces/vinayedula/RefDiffNet}"

if [[ ! -f weights/prebackbone_a11_ca.pt ]]; then
  echo "Run: bash prepare_space.sh   (or extract_prebackbone_weights.py)"
  exit 1
fi

git init
git lfs install 2>/dev/null || true

git add \
  app.py \
  a11_ca.py \
  prebackbone_infer.py \
  gradio_patch.py \
  extract_prebackbone_weights.py \
  deploy_to_refdiffnet.sh \
  prepare_space.sh \
  requirements.txt \
  setup.sh \
  README.md \
  .gitattributes \
  .gitignore \
  examples/ \
  weights/prebackbone_a11_ca.pt

if ! git diff --cached --quiet; then
  git commit -m "RefDiffNet: standalone A11_CA prebackbone demo"
elif ! git rev-parse HEAD >/dev/null 2>&1; then
  echo "ERROR: No commit to push. Check git add / files."
  exit 1
else
  echo "No new changes; pushing existing commit."
fi

git branch -M main

if git remote get-url origin &>/dev/null; then
  git remote set-url origin "${SPACE_REMOTE}"
else
  git remote add origin "${SPACE_REMOTE}"
fi

echo "Pushing branch 'main' to ${SPACE_REMOTE}"
echo "HF token as password: https://huggingface.co/settings/tokens"
git push -u origin main