-
Notifications
You must be signed in to change notification settings - Fork 135
72 lines (67 loc) · 2.08 KB
/
python-script-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build and Package Python Code
on:
workflow_dispatch:
inputs:
model_dir:
description: "Path to model directory in github repo"
required: true
repo_name:
description: "name of repo to be checked out"
required: true
branch_name:
description: "name of branch to be checked out"
required: true
default: main
hf_repo:
description: "name of huggingface repo to be pushed"
required: true
hf_prefix_branch:
description: "prefix of hf branch"
required: false
env:
MODEL_DIR: ${{ inputs.model_dir }}
REPO_NAME: ${{ inputs.repo_name}}
BRANCH_NAME: ${{ inputs.branch_name }}
HF_REPO: ${{ inputs.hf_repo }}
HF_PREFIX_BRANCH: ${{ inputs.hf_prefix_branch }}
jobs:
build-and-test:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 3600
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "amd64"
runs-on: "ubuntu-20-04-cuda-12-0"
- os: "mac"
name: "amd64"
runs-on: "macos-selfhosted-12"
- os: "mac"
name: "arm64"
runs-on: "macos-selfhosted-12-arm64"
- os: "windows"
name: "amd64"
runs-on: "windows-cuda-12-0"
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{env.REPO_NAME}}
ref: ${{env.BRANCH_NAME}}
- name: use python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hf-transfer huggingface_hub
- name: Upload Artifact
run: |
huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_WRITE }} --add-to-git-credential
cd ${{env.MODEL_DIR}} && huggingface-cli upload ${{env.HF_REPO}} . . --revision ${{env.HF_PREFIX_BRANCH}}-${{ matrix.os }}-${{ matrix.name }}
huggingface-cli logout