Skip to content

Commit

Permalink
WIP github runner tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCreator committed Aug 24, 2023
1 parent 3ed0718 commit d0dda19
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/rwkv-x-exp-lane1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
run: |
cd ./notebook/github-runner
python3 ./hf-download.py "experiment/rwkv-x-exp/${{github.event.inputs.notebookFile}}" "${{github.event.inputs.huggingFaceRepo}}"
ls -alh ../../model/
cd ../../model/ && pwd
ls -alh ./
- name: Run the notebook, with harness
run: |
cd ./notebook/github-runner
Expand Down
29 changes: 16 additions & 13 deletions notebook/github-runner/hf-upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@
print(f"# Uploading to: {hf_url}")
print(f"# ------------------------------------")

print("# Uploading the models ... ")

# Upload the models
api.upload_folder(
folder_path=MODEL_DIR,
repo_id=REPO_URI,
path_in_repo=NOTEBOOK_SUBDIR,
repo_type="model",
multi_commits=True,
allow_patterns=["*.pth"],
commit_message=f"[GHA] {NOTEBOOK_FILE} result models"
)

print("# Uploading the notebooks ... ")

# Upload the ipynb files
Expand All @@ -55,6 +42,22 @@
commit_message=f"[GHA] {NOTEBOOK_FILE} result notebooks"
)

# Upload the models
print("# Uploading the models ... ")
try:
api.upload_folder(
folder_path=MODEL_DIR,
repo_id=REPO_URI,
path_in_repo=NOTEBOOK_SUBDIR,
repo_type="model",
multi_commits=True,
allow_patterns=["*.pth"],
commit_message=f"[GHA] {NOTEBOOK_FILE} result models"
)
except Exception as e:
print("# Skipping model upload due to error ... ")
print(e)

print(f"# ------------------------------------")
print(f"# Uploaded to: {hf_url}")
print(f"# ------------------------------------")

0 comments on commit d0dda19

Please sign in to comment.