Spaces:
Paused
Paused
Commit
·
17ed8db
1
Parent(s):
63b19c2
Ajout sync huggingface
Browse files
.github/workflows/sync-huggingface.yml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face Hub
|
| 2 |
+
on:
|
| 3 |
+
push:
|
| 4 |
+
branches: [main]
|
| 5 |
+
|
| 6 |
+
jobs:
|
| 7 |
+
sync-to-hub:
|
| 8 |
+
runs-on: ubuntu-latest
|
| 9 |
+
steps:
|
| 10 |
+
- uses: actions/checkout@v3
|
| 11 |
+
- name: Push to HF Hub
|
| 12 |
+
env:
|
| 13 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 14 |
+
run: |
|
| 15 |
+
pip install huggingface_hub
|
| 16 |
+
python -c "from huggingface_hub import HfApi; HfApi().create_repo('${{ github.repository }}', repo_type='model', private=False)"
|
| 17 |
+
python -c "from huggingface_hub import HfApi; HfApi().upload_folder(folder_path='.', repo_id='${{ github.repository }}', repo_type='model')"
|