Selaa lähdekoodia

Publish wasm to model scope (#309)

Fangjun Kuang 1 vuosi sitten
vanhempi
sitoutus
c31e673361

+ 34 - 0
.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 }}

+ 34 - 0
.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 }}