Spaces:
Sleeping
Sleeping
[fix]: upgrade code deployment
Browse files
.github/workflows/sync_ahf.yaml
CHANGED
|
@@ -14,6 +14,7 @@ env:
|
|
| 14 |
jobs:
|
| 15 |
sync-to-hub:
|
| 16 |
runs-on: ubuntu-latest
|
|
|
|
| 17 |
steps:
|
| 18 |
- uses: actions/checkout@v3
|
| 19 |
with:
|
|
@@ -25,16 +26,21 @@ jobs:
|
|
| 25 |
git config --global user.email "$EMAIL_USER"
|
| 26 |
git config --global user.name "tph-kds"
|
| 27 |
|
| 28 |
-
- name: Remove large model files
|
| 29 |
-
run: |
|
| 30 |
-
find checkpoints -type f -name "*.pth" -delete || true
|
| 31 |
-
git rm -f checkpoints/**/*.pth || true
|
| 32 |
-
git commit -m "Remove .pth files before syncing to HF Space" || echo "No .pth files to remove"
|
| 33 |
-
|
| 34 |
- name: Setup Git LFS
|
| 35 |
run: git lfs install
|
| 36 |
|
| 37 |
-
- name:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
run: |
|
| 39 |
git fetch origin main
|
| 40 |
git rebase origin/main || true
|
|
|
|
| 14 |
jobs:
|
| 15 |
sync-to-hub:
|
| 16 |
runs-on: ubuntu-latest
|
| 17 |
+
|
| 18 |
steps:
|
| 19 |
- uses: actions/checkout@v3
|
| 20 |
with:
|
|
|
|
| 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: Clean Git history (sync with origin)
|
| 44 |
run: |
|
| 45 |
git fetch origin main
|
| 46 |
git rebase origin/main || true
|