File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555 - uses : actions/setup-python@v5
5656 with :
5757 python-version : " 3.11"
58- - run : pip install --upgrade "huggingface_hub>=1.16.1 "
58+ - run : pip install --upgrade "huggingface_hub>=1.18.0 "
5959
6060 - name : Exchange GitHub OIDC token for a Hub token
6161 run : |
@@ -100,19 +100,9 @@ jobs:
100100 } >> "$GITHUB_ENV"
101101
102102 - name : Upload checkpoint
103- # `hf upload` calls create_repo() first, which a Trusted Publisher token
104- # isn't allowed to do. Call upload_folder() directly to skip that step.
105103 run : |
106- python - <<'PY'
107- import os
108- from huggingface_hub import upload_folder
109-
110- upload_folder(
111- repo_id="acme/awesome-model",
112- folder_path="./checkpoint",
113- commit_message=f"Publish from {os.environ['GITHUB_SHA'][:7]}",
114- )
115- PY
104+ hf upload acme/awesome-model ./checkpoint . \
105+ --commit-message "Publish from ${GITHUB_SHA::7}"
116106` ` `
117107
118108That's it — ` huggingface_hub` picks up `HF_TOKEN` from the environment.
You can’t perform that action at this time.
0 commit comments