Skip to content

Commit 18b278a

Browse files
authored
Merge pull request #2 from kod-kristoff/add-gh-action-to-upload-to-huggingface
Add script and Github Action for updating HF
2 parents a46f157 + 7227b25 commit 18b278a

File tree

4 files changed

+565
-0
lines changed

4 files changed

+565
-0
lines changed

.github/scripts/upload_to_hf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# /// script
2+
# requires-python = ">=3.11"
3+
# dependencies = []
4+
# ///
5+
6+
7+
def main() -> None:
8+
print("Hello from upload_to_hf.py!")
9+
10+
11+
if __name__ == "__main__":
12+
main()

.github/workflows/upload_to_hf.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Upload dataset to Hugging Face
2+
on:
3+
push:
4+
branches:
5+
- main
6+
# to run this workflow manually from the Actions tab
7+
workflow_dispatch:
8+
9+
env:
10+
PYTHON_VERSION: "3.11"
11+
UV_VERSION: "0.9.15"
12+
13+
jobs:
14+
upload-to-huggingface-hub:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
20+
- name: Set up UV and Python
21+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # 7.1.4
22+
with:
23+
version: ${{ env.UV_VERSION }}
24+
enable-cache: true
25+
python-version: ${{ env.PYTHON_VERSION }}
26+
27+
- name: Install hf cli
28+
run: uv tool install huggingface-hub
29+
30+
- name: Login to huggingface-hub
31+
run: hf auth login --token ${{ secrets.HUGGINGFACE_TOKEN }}
32+
33+
- name: Upload all models to Hugging Face
34+
run: ./upload_to_hf.sh
35+

0 commit comments

Comments
 (0)