Skip to content

Commit 89c2226

Browse files
pjt222claude
andcommitted
fix(ci): use HfApi Python directly instead of huggingface-cli
The CLI binary isn't found on GHA runners despite pip install. Use the Python API directly via upload_folder(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a5888e3 commit 89c2226

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/deploy-hf-spaces.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,15 @@ jobs:
4444
HF_TOKEN: ${{ secrets.HF_TOKEN }}
4545
run: |
4646
pip install huggingface_hub
47-
huggingface-cli upload pjt222/jigsawR . . --repo-type space --token $HF_TOKEN
47+
python -c "
48+
from huggingface_hub import HfApi
49+
import os
50+
api = HfApi(token=os.environ['HF_TOKEN'])
51+
api.upload_folder(
52+
folder_path='.',
53+
repo_id='pjt222/jigsawR',
54+
repo_type='space',
55+
ignore_patterns=['.git/*'],
56+
)
57+
print('Upload complete!')
58+
"

0 commit comments

Comments
 (0)