Spaces:
Sleeping
Sleeping
Delete .github
Browse files
.github/workflows/sync_ahf.yaml
DELETED
|
@@ -1,55 +0,0 @@
|
|
| 1 |
-
name: Sync to Hugging Face hub
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
push:
|
| 5 |
-
branches: [main]
|
| 6 |
-
workflow_dispatch:
|
| 7 |
-
|
| 8 |
-
env:
|
| 9 |
-
HF_USERNAME: vikenkd
|
| 10 |
-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 11 |
-
SPACE_NAME: image_classification
|
| 12 |
-
EMAIL_USER: ${{ secrets.EMAIL_USER }}
|
| 13 |
-
|
| 14 |
-
jobs:
|
| 15 |
-
sync-to-hub:
|
| 16 |
-
runs-on: ubuntu-latest
|
| 17 |
-
|
| 18 |
-
steps:
|
| 19 |
-
- uses: actions/checkout@v3
|
| 20 |
-
with:
|
| 21 |
-
fetch-depth: 0
|
| 22 |
-
lfs: true
|
| 23 |
-
|
| 24 |
-
- name: Configure Git
|
| 25 |
-
run: |
|
| 26 |
-
git config --global user.email "$EMAIL_USER"
|
| 27 |
-
git config --global user.name "tph-kds"
|
| 28 |
-
|
| 29 |
-
- name: Setup Git LFS
|
| 30 |
-
run: git lfs install
|
| 31 |
-
|
| 32 |
-
- name: Remove large/binary model files from history
|
| 33 |
-
run: |
|
| 34 |
-
pip install git-filter-repo
|
| 35 |
-
# Remove any checkpoints or .pth, .pt, .bin files from history
|
| 36 |
-
git filter-repo --path checkpoints/ --invert-paths --force || true
|
| 37 |
-
git filter-repo --path-glob '*.pth' --invert-paths --force || true
|
| 38 |
-
git filter-repo --path-glob '*.pt' --invert-paths --force || true
|
| 39 |
-
git filter-repo --path-glob '*.bin' --invert-paths --force || true
|
| 40 |
-
git add .
|
| 41 |
-
git commit -m "Clean binary files from history" || true
|
| 42 |
-
|
| 43 |
-
- name: Sync with origin (safe)
|
| 44 |
-
run: |
|
| 45 |
-
if git remote | grep origin; then
|
| 46 |
-
git fetch origin main || true
|
| 47 |
-
git rebase origin/main || true
|
| 48 |
-
else
|
| 49 |
-
echo "No origin remote found, skipping rebase."
|
| 50 |
-
fi
|
| 51 |
-
|
| 52 |
-
- name: Force push to Hugging Face Space
|
| 53 |
-
run: |
|
| 54 |
-
git remote add hf https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME || true
|
| 55 |
-
git push hf main --force
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|