vikenkd commited on
Commit
4534f8f
·
1 Parent(s): d57e61e

[feat]: upgrade code deployment

Browse files
Files changed (1) hide show
  1. .github/workflows/sync_ahf.yaml +13 -5
.github/workflows/sync_ahf.yaml CHANGED
@@ -25,12 +25,20 @@ jobs:
25
  git config --global user.email "$EMAIL_USER"
26
  git config --global user.name "tph-kds"
27
 
28
- # Xóa file .pth trước khi push (để tránh bị Hugging Face chặn)
29
- - name: Remove local model checkpoints
30
  run: |
31
- rm -f checkpoints/**/*.pth || true
32
-
 
 
 
 
 
 
 
 
33
  - name: Force push to Hugging Face Space
34
  run: |
35
  git remote add hf https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME || true
36
- git push hf main --force
 
25
  git config --global user.email "$EMAIL_USER"
26
  git config --global user.name "tph-kds"
27
 
28
+ # Bước quan trọng: Xóa file .pth khỏi repo (để tránh push binary)
29
+ - name: Remove large model files
30
  run: |
31
+ find checkpoints -type f -name "*.pth" -delete || true
32
+ git rm -f checkpoints/**/*.pth || true
33
+ git commit -m "Remove .pth files before syncing to HF Space" || echo "No .pth files to remove"
34
+
35
+ # Đảm bảo repo sạch, không lỗi
36
+ - name: Clean Git history (optional but safe)
37
+ run: |
38
+ git fetch origin main
39
+ git rebase origin/main || true
40
+
41
  - name: Force push to Hugging Face Space
42
  run: |
43
  git remote add hf https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME || true
44
+ git push hf main --force