Spaces:
Runtime error
Runtime error
Update workflow to upload to Hugging Face
Browse files- .github/workflows/sync.yml +15 -17
.github/workflows/sync.yml
CHANGED
|
@@ -1,18 +1,16 @@
|
|
| 1 |
-
name:
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
- uses: actions/checkout@v3
|
| 10 |
-
with:
|
| 11 |
-
fetch-depth: 0
|
| 12 |
-
lfs: true
|
| 13 |
-
- name: Push to hub
|
| 14 |
-
env:
|
| 15 |
-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 16 |
-
run: git push -f https://YamenRM:$HF_TOKEN@huggingface.co/spaces/YamenRM/workflow-analyzer main
|
| 17 |
-
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- name: Upload to Hugging Face
|
| 2 |
+
env:
|
| 3 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 4 |
+
run: |
|
| 5 |
+
pip install huggingface_hub
|
| 6 |
+
python - <<EOF
|
| 7 |
+
from huggingface_hub import upload_folder
|
| 8 |
+
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
upload_folder(
|
| 11 |
+
folder_path='.',
|
| 12 |
+
repo_id='YamenRM/workflow-analyzer',
|
| 13 |
+
repo_type='space',
|
| 14 |
+
token=os.environ['HF_TOKEN']
|
| 15 |
+
)
|
| 16 |
+
EOF
|