Skip to content

Commit 85fc716

Browse files
committed
fix: use Python API instead of removed huggingface-cli command
1 parent 8a2ab36 commit 85fc716

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/sync-to-huggingface.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,25 @@ jobs:
1717
- name: Fetch all LFS objects
1818
run: git lfs pull
1919

20-
- name: Install git-xet and configure
21-
env:
22-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
23-
run: |
24-
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/huggingface/xet-core/refs/heads/main/git_xet/install.sh | sudo sh
25-
git xet install
26-
git xet --version
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.12'
2723

2824
- name: Push to Hugging Face
2925
env:
3026
HF_TOKEN: ${{ secrets.HF_TOKEN }}
3127
run: |
32-
pip install -U huggingface_hub hf_xet
33-
export PATH="$HOME/.local/bin:$PATH"
34-
huggingface-cli upload dmpantiu/Eurus . . --repo-type space --token $HF_TOKEN
35-
28+
pip install -U huggingface_hub
29+
python -c "
30+
from huggingface_hub import HfApi
31+
import os
32+
api = HfApi()
33+
api.upload_folder(
34+
folder_path='.',
35+
repo_id='dmpantiu/Eurus',
36+
repo_type='space',
37+
token=os.environ['HF_TOKEN'],
38+
ignore_patterns=['.git/*', '.github/*'],
39+
)
40+
print('Upload complete')
41+
"

0 commit comments

Comments
 (0)