name: export-peng-cheng-starling-to-onnx on: push: branches: - fix-ci-2 workflow_dispatch: concurrency: group: export-peng-cheng-starling-to-onnx-${{ github.ref }} cancel-in-progress: true jobs: export-peng-cheng-starling-to-onnx: if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj' name: export peng cheng starling ${{ matrix.version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] python-version: ["3.10"] steps: - uses: actions/checkout@v4 - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Python dependencies shell: bash run: | pip install "numpy<=1.26.4" onnx==1.16.0 onnxruntime==1.17.1 - name: Run shell: bash run: | cd scripts/peng-cheng-starling ./run.sh python3 ./quantize_models.py ls -lh rm encoder-epoch-75-avg-11-chunk-16-left-128.onnx rm joiner-epoch-75-avg-11-chunk-16-left-128.onnx echo "----" ls -lh - name: Collect results ${{ matrix.version }} shell: bash run: | src=scripts/peng-cheng-starling d=sherpa-onnx-streaming-zipformer-ar_en_id_ja_ru_th_vi_zh-2025-02-10 mkdir $d mv -v $src/*.onnx $d cp -v $src/README.md $d cp -v $src/bpe.model $d cp -v $src/tokens.txt $d cp -av $src/test_wavs $d ls -lh $d/ tar cjfv $d.tar.bz2 $d ls -lh $d.tar.bz2 - name: Publish to huggingface ${{ matrix.version }} env: HF_TOKEN: ${{ secrets.HF_TOKEN }} uses: nick-fields/retry@v3 with: max_attempts: 20 timeout_seconds: 200 shell: bash command: | git config --global user.email "csukuangfj@gmail.com" git config --global user.name "Fangjun Kuang" rm -rf huggingface export GIT_LFS_SKIP_SMUDGE=1 export GIT_CLONE_PROTECTION_ACTIVE=false src=sherpa-onnx-streaming-zipformer-ar_en_id_ja_ru_th_vi_zh-2025-02-10 git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$src huggingface cd huggingface rm -rf ./* git fetch git pull cp -av ../$src/* ./ git lfs track "*.onnx" git add . ls -lh git status git commit -m "add models" git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$src main || true - name: Release if: github.repository_owner == 'csukuangfj' uses: svenstaro/upload-release-action@v2 with: file_glob: true file: ./*.tar.bz2 overwrite: true repo_name: k2-fsa/sherpa-onnx repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} tag: asr-models - name: Release if: github.repository_owner == 'k2-fsa' uses: svenstaro/upload-release-action@v2 with: file_glob: true file: ./*.tar.bz2 overwrite: true tag: asr-models