Spaces:
Sleeping
Sleeping
phanny commited on
Commit ·
11d6ed2
1
Parent(s): 7df54a4
fix bug
Browse files- scripts/push_to_hf.sh +20 -0
scripts/push_to_hf.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Push current branch to Hugging Face Spaces (main), removing binary xlsx from history.
|
| 3 |
+
# HF rejects binary files; student-version history contains the xlsx, so we push a cleaned branch.
|
| 4 |
+
set -e
|
| 5 |
+
BRANCH="${1:-student-version}"
|
| 6 |
+
REMOTE="${2:-huggingface}"
|
| 7 |
+
HF_BRANCH="${3:-hf-push}"
|
| 8 |
+
|
| 9 |
+
echo "Creating $HF_BRANCH from $BRANCH, stripping data/National_Directory_SU_2024.xlsx from history..."
|
| 10 |
+
git checkout -B "$HF_BRANCH" "$BRANCH"
|
| 11 |
+
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch data/National_Directory_SU_2024.xlsx' --prune-empty HEAD
|
| 12 |
+
|
| 13 |
+
echo "Pushing $HF_BRANCH to $REMOTE main (force)..."
|
| 14 |
+
git push "$REMOTE" "$HF_BRANCH:main" --force
|
| 15 |
+
|
| 16 |
+
echo "Switching back to $BRANCH and deleting $HF_BRANCH..."
|
| 17 |
+
git checkout "$BRANCH"
|
| 18 |
+
git branch -D "$HF_BRANCH"
|
| 19 |
+
|
| 20 |
+
echo "Done. Space updated: https://huggingface.co/spaces/phanny/6.C395-chatbot"
|