Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 216b66a

Browse files
Fix: upload venv to hf instead of github releas
1 parent 768815c commit 216b66a

File tree

1 file changed

+61
-12
lines changed

1 file changed

+61
-12
lines changed

.github/workflows/python-package.yml

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,22 @@ on:
1818
description: "name of branch to be checked out"
1919
required: true
2020
default: main
21+
hf_repo:
22+
description: "name of huggingface repo to be pushed"
23+
required: true
24+
hf_prefix_branch:
25+
description: "prefix of hf branch"
26+
required: false
2127

2228

2329

2430
env:
25-
MODEL_DIR: models/fish-speech # ${{ inputs.model_dir }}
26-
MODEL_NAME: fish-speech # ${{ inputs.model_name }}
31+
MODEL_DIR: models/ichigo # ${{ inputs.model_dir }}
32+
MODEL_NAME: ichigo # ${{ inputs.model_name }}
2733
REPO_NAME: janhq/models # ${{ inputs.model_name }}
2834
BRANCH_NAME: feat/ci-python-models # ${{ inputs.model_name }}
35+
HF_REPO: cortexso/test # ${{ inputs.hf_repo }}
36+
HF_PREFIX_BRANCH: fp16 # ${{ inputs.hf_prefix_branch }}
2937

3038
jobs:
3139
build-and-test:
@@ -35,15 +43,15 @@ jobs:
3543
fail-fast: false
3644
matrix:
3745
include:
38-
# - os: "linux"
39-
# name: "amd64"
40-
# runs-on: "ubuntu-20-04-cuda-12-0"
41-
- os: "mac"
46+
- os: "linux"
4247
name: "amd64"
43-
runs-on: "macos-selfhosted-12"
44-
- os: "mac"
45-
name: "arm64"
46-
runs-on: "macos-selfhosted-12-arm64"
48+
runs-on: "ubuntu-20-04-cuda-12-0"
49+
# - os: "mac"
50+
# name: "amd64"
51+
# runs-on: "macos-selfhosted-12"
52+
# - os: "mac"
53+
# name: "arm64"
54+
# runs-on: "macos-selfhosted-12-arm64"
4755
# - os: "windows"
4856
# name: "amd64"
4957
# runs-on: "windows-cuda-12-0"
@@ -213,15 +221,56 @@ jobs:
213221
QUILL_NOTARY_ISSUER: ${{ secrets.NOTARY_ISSUER }}
214222
QUILL_NOTARY_KEY: "/tmp/notary-key.p8"
215223

216-
- name: Upload Artifact
217-
#if : runner.os == 'windows' || runner.os == 'linux'
224+
# - name: Upload Artifact
225+
# #if : runner.os == 'windows' || runner.os == 'linux'
226+
# uses: actions/upload-artifact@v4
227+
# with:
228+
# name: ${{env.MODEL_NAME}}-${{ matrix.os }}-${{ matrix.name }}
229+
# path: ${{env.PYTHON_FOLDER}}
230+
# include-hidden-files: true
231+
# compression-level: 9
232+
233+
- name: Upload Artifact MacOS
234+
if : runner.os == 'macOS'
235+
run: |
236+
brew install zip
237+
cd ${{env.PYTHON_FOLDER}} && zip -r venv.zip *
238+
conda create -y -n hf-upload python=3.11
239+
source $HOME/miniconda3/bin/activate base
240+
conda init
241+
conda activate hf-upload
242+
python -m pip install hf-transfer huggingface_hub
243+
huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_WRITE }} --add-to-git-credential
244+
huggingface-cli upload ${{env.HF_REPO}} venv.zip . --revision ${{env.HF_PREFIX_BRANCH}}-${{ matrix.os }}-${{ matrix.name }}"
245+
rm -rf venv.zip
246+
huggingface-cli logout
247+
248+
- name: Upload Artifact Linux
249+
if : runner.os == 'linux'
250+
run: |
251+
sudo apt-get install -y zip
252+
cd ${{env.PYTHON_FOLDER}} && zip -r venv.zip *
253+
conda create -y -n hf-upload python=3.11
254+
source $HOME/miniconda3/bin/activate base
255+
conda init
256+
conda activate hf-upload
257+
python -m pip install hf-transfer huggingface_hub
258+
huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_WRITE }} --add-to-git-credential
259+
huggingface-cli upload ${{env.HF_REPO}} venv.zip . --revision ${{env.HF_PREFIX_BRANCH}}-${{ matrix.os }}-${{ matrix.name }}"
260+
rm -rf venv.zip
261+
huggingface-cli logout
262+
263+
264+
- name: Upload Artifact Windows
265+
if : runner.os == 'windows'
218266
uses: actions/upload-artifact@v4
219267
with:
220268
name: ${{env.MODEL_NAME}}-${{ matrix.os }}-${{ matrix.name }}
221269
path: ${{env.PYTHON_FOLDER}}
222270
include-hidden-files: true
223271
compression-level: 9
224272

273+
225274
- name: Post Upload windows
226275
if : runner.os == 'windows'
227276
run: |

0 commit comments

Comments
 (0)