From c31e6733612b48382a1e6d6d4fb34cbe652e0dcd Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 21 Feb 2024 19:20:15 +0800 Subject: [PATCH] Publish wasm to model scope (#309) --- .github/workflows/wasm-simd-hf-space-en.yaml | 34 +++++++++++++++++++ .../workflows/wasm-simd-hf-space-zh-en.yaml | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/.github/workflows/wasm-simd-hf-space-en.yaml b/.github/workflows/wasm-simd-hf-space-en.yaml index 0193804f..ba587084 100644 --- a/.github/workflows/wasm-simd-hf-space-en.yaml +++ b/.github/workflows/wasm-simd-hf-space-en.yaml @@ -70,6 +70,40 @@ jobs: name: sherpa-ncnn-wasm-simd-en path: ./sherpa-ncnn-wasm-simd-*.tar.bz2 + - name: Publish to ModelScope + env: + MS_TOKEN: ${{ secrets.MODEL_SCOPE_GIT_TOKEN }} + uses: nick-fields/retry@v2 + with: + max_attempts: 20 + timeout_seconds: 200 + shell: bash + command: | + SHERPA_NCNN_VERSION=v$(grep "SHERPA_NCNN_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) + + git config --global user.email "csukuangfj@gmail.com" + git config --global user.name "Fangjun Kuang" + + rm -rf huggingface + export GIT_LFS_SKIP_SMUDGE=1 + + git clone http://www.modelscope.cn/studios/k2-fsa/web-assembly-asr-sherpa-ncnn-en.git ms + + cd ms + git fetch + git pull + git merge -m "merge remote" --ff origin main + + cp -v ../sherpa-ncnn-wasm-simd-${SHERPA_NCNN_VERSION}/* . + + git status + git lfs track "*.data" + git lfs track "*.wasm" + + git add . + git commit -m "update model" + git push http://oauth2:$MS_TOKEN@www.modelscope.cn/studios/k2-fsa/web-assembly-asr-sherpa-ncnn-en.git + - name: Publish to huggingface env: HF_TOKEN: ${{ secrets.HF_TOKEN }} diff --git a/.github/workflows/wasm-simd-hf-space-zh-en.yaml b/.github/workflows/wasm-simd-hf-space-zh-en.yaml index da352fb4..e13f0711 100644 --- a/.github/workflows/wasm-simd-hf-space-zh-en.yaml +++ b/.github/workflows/wasm-simd-hf-space-zh-en.yaml @@ -70,6 +70,40 @@ jobs: name: sherpa-ncnn-wasm-simd-zh-en path: ./sherpa-ncnn-wasm-simd-*.tar.bz2 + - name: Publish to ModelScope + env: + MS_TOKEN: ${{ secrets.MODEL_SCOPE_GIT_TOKEN }} + uses: nick-fields/retry@v2 + with: + max_attempts: 20 + timeout_seconds: 200 + shell: bash + command: | + SHERPA_NCNN_VERSION=v$(grep "SHERPA_NCNN_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) + + git config --global user.email "csukuangfj@gmail.com" + git config --global user.name "Fangjun Kuang" + + rm -rf huggingface + export GIT_LFS_SKIP_SMUDGE=1 + + git clone http://www.modelscope.cn/studios/k2-fsa/web-assembly-asr-sherpa-ncnn-zh-en.git ms + + cd ms + git fetch + git pull + git merge -m "merge remote" --ff origin main + + cp -v ../sherpa-ncnn-wasm-simd-${SHERPA_NCNN_VERSION}/* . + + git status + git lfs track "*.data" + git lfs track "*.wasm" + + git add . + git commit -m "update model" + git push http://oauth2:$MS_TOKEN@www.modelscope.cn/studios/k2-fsa/web-assembly-asr-sherpa-ncnn-zh-en.git + - name: Publish to huggingface env: HF_TOKEN: ${{ secrets.HF_TOKEN }}