From 46a976166d9bf40182bd8b3b45ccd2d465e5404e Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Tue, 31 Dec 2024 14:17:20 +0800 Subject: [PATCH] Upload models to huggingface --- .github/scripts/baker_zh/TTS/run-matcha.sh | 14 -------------- .github/workflows/baker_zh.yml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/scripts/baker_zh/TTS/run-matcha.sh b/.github/scripts/baker_zh/TTS/run-matcha.sh index 9e7094687..79cd1ebc1 100755 --- a/.github/scripts/baker_zh/TTS/run-matcha.sh +++ b/.github/scripts/baker_zh/TTS/run-matcha.sh @@ -156,21 +156,7 @@ EOF tar cvjf $d.tar.bz2 $d mv $d.tar.bz2 /icefall - log "Upload onnx models to huggingface" - GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/$d hf - cp -av $d/* hf/ - pushd hf - git add . - - git config --global user.name "csukuangfj" - git config --global user.email "csukuangfj@gmail.com" - git config --global lfs.allowincompletepush true - - git commit -m "upload model" && git push https://csukuangfj:${HF_TOKEN}@huggingface.co/cskuangfj/$d main || true - popd - - rm -rf $d } prepare_data diff --git a/.github/workflows/baker_zh.yml b/.github/workflows/baker_zh.yml index bb51d09a9..d3bb9f7a8 100644 --- a/.github/workflows/baker_zh.yml +++ b/.github/workflows/baker_zh.yml @@ -119,6 +119,28 @@ jobs: name: step-6 path: ./model-steps-6.onnx + - name: Upload models to huggingface + if: matrix.python-version == '3.9' && matrix.torch-version == '2.3.0' && github.event_name == 'push' + shell: bash + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} + run: | + d=matcha-icefall-zh-baker + + log "Upload onnx models to huggingface" + GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/$d hf + cp -av $d/* hf/ + + pushd hf + git add . + + git config --global user.name "csukuangfj" + git config --global user.email "csukuangfj@gmail.com" + git config --global lfs.allowincompletepush true + + git commit -m "upload model" && git push https://csukuangfj:${HF_TOKEN}@huggingface.co/cskuangfj/$d main || true + popd + - name: Release exported onnx models if: matrix.python-version == '3.9' && matrix.torch-version == '2.3.0' && github.event_name == 'push' uses: svenstaro/upload-release-action@v2