Committed by
GitHub
Add test about whisper large-v3 for .Net (#1187)
正在显示
4 个修改的文件
包含
148 行增加
和
0 行删除
| @@ -4,38 +4,68 @@ cd dotnet-examples/ | @@ -4,38 +4,68 @@ cd dotnet-examples/ | ||
| 4 | 4 | ||
| 5 | cd ./offline-decode-files | 5 | cd ./offline-decode-files |
| 6 | ./run-sense-voice-ctc.sh | 6 | ./run-sense-voice-ctc.sh |
| 7 | +rm -rf sherpa-onnx-* | ||
| 8 | + | ||
| 7 | ./run-paraformer-itn.sh | 9 | ./run-paraformer-itn.sh |
| 10 | +rm -rf sherpa-onnx-* | ||
| 11 | + | ||
| 8 | ./run-telespeech-ctc.sh | 12 | ./run-telespeech-ctc.sh |
| 13 | +rm -rf sherpa-onnx-* | ||
| 14 | + | ||
| 9 | ./run-nemo-ctc.sh | 15 | ./run-nemo-ctc.sh |
| 16 | +rm -rf sherpa-onnx-* | ||
| 17 | + | ||
| 10 | ./run-paraformer.sh | 18 | ./run-paraformer.sh |
| 19 | +rm -rf sherpa-onnx-* | ||
| 20 | + | ||
| 11 | ./run-zipformer.sh | 21 | ./run-zipformer.sh |
| 22 | +rm -rf sherpa-onnx-* | ||
| 23 | + | ||
| 12 | ./run-hotwords.sh | 24 | ./run-hotwords.sh |
| 25 | +rm -rf sherpa-onnx-* | ||
| 26 | + | ||
| 13 | ./run-whisper.sh | 27 | ./run-whisper.sh |
| 28 | +rm -rf sherpa-onnx-* | ||
| 29 | + | ||
| 30 | +./run-whisper-large-v3.sh | ||
| 31 | +rm -rf sherpa-onnx-* | ||
| 32 | + | ||
| 14 | ./run-tdnn-yesno.sh | 33 | ./run-tdnn-yesno.sh |
| 34 | +rm -rf sherpa-onnx-* | ||
| 15 | 35 | ||
| 16 | cd ../keyword-spotting-from-files | 36 | cd ../keyword-spotting-from-files |
| 17 | ./run.sh | 37 | ./run.sh |
| 18 | 38 | ||
| 19 | cd ../online-decode-files | 39 | cd ../online-decode-files |
| 20 | ./run-transducer-itn.sh | 40 | ./run-transducer-itn.sh |
| 41 | +rm -rf sherpa-onnx-* | ||
| 42 | + | ||
| 21 | ./run-zipformer2-ctc.sh | 43 | ./run-zipformer2-ctc.sh |
| 44 | +rm -rf sherpa-onnx-* | ||
| 45 | + | ||
| 22 | ./run-transducer.sh | 46 | ./run-transducer.sh |
| 47 | +rm -rf sherpa-onnx-* | ||
| 48 | + | ||
| 23 | ./run-paraformer.sh | 49 | ./run-paraformer.sh |
| 50 | +rm -rf sherpa-onnx-* | ||
| 24 | 51 | ||
| 25 | cd ../vad-non-streaming-asr-paraformer | 52 | cd ../vad-non-streaming-asr-paraformer |
| 26 | ./run.sh | 53 | ./run.sh |
| 27 | 54 | ||
| 28 | cd ../offline-punctuation | 55 | cd ../offline-punctuation |
| 29 | ./run.sh | 56 | ./run.sh |
| 57 | +rm -rf sherpa-onnx-* | ||
| 30 | 58 | ||
| 31 | cd ../speaker-identification | 59 | cd ../speaker-identification |
| 32 | ./run.sh | 60 | ./run.sh |
| 33 | 61 | ||
| 34 | cd ../streaming-hlg-decoding/ | 62 | cd ../streaming-hlg-decoding/ |
| 35 | ./run.sh | 63 | ./run.sh |
| 64 | +rm -rf sherpa-onnx-* | ||
| 36 | 65 | ||
| 37 | cd ../spoken-language-identification | 66 | cd ../spoken-language-identification |
| 38 | ./run.sh | 67 | ./run.sh |
| 68 | +rm -rf sherpa-onnx-* | ||
| 39 | 69 | ||
| 40 | cd ../offline-tts | 70 | cd ../offline-tts |
| 41 | ./run-aishell3.sh | 71 | ./run-aishell3.sh |
| @@ -32,6 +32,49 @@ jobs: | @@ -32,6 +32,49 @@ jobs: | ||
| 32 | with: | 32 | with: |
| 33 | fetch-depth: 0 | 33 | fetch-depth: 0 |
| 34 | 34 | ||
| 35 | + - name: Free space | ||
| 36 | + if: matrix.os == 'ubuntu-latest' | ||
| 37 | + shell: bash | ||
| 38 | + run: | | ||
| 39 | + df -h | ||
| 40 | + rm -rf /opt/hostedtoolcache | ||
| 41 | + df -h | ||
| 42 | + | ||
| 43 | + - name: Free more space | ||
| 44 | + if: matrix.os == 'ubuntu-latest' | ||
| 45 | + shell: bash | ||
| 46 | + run: | | ||
| 47 | + # https://github.com/orgs/community/discussions/25678 | ||
| 48 | + cd /opt | ||
| 49 | + find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';' | ||
| 50 | + | ||
| 51 | + sudo rm -rf /usr/share/dotnet | ||
| 52 | + sudo rm -rf "/usr/local/share/boost" | ||
| 53 | + sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
| 54 | + | ||
| 55 | + - name: Free Disk Space (Ubuntu) | ||
| 56 | + if: matrix.os == 'ubuntu-latest' | ||
| 57 | + uses: jlumbroso/free-disk-space@main | ||
| 58 | + with: | ||
| 59 | + # this might remove tools that are actually needed, | ||
| 60 | + # if set to "true" but frees about 6 GB | ||
| 61 | + tool-cache: false | ||
| 62 | + | ||
| 63 | + # all of these default to true, but feel free to set to | ||
| 64 | + # "false" if necessary for your workflow | ||
| 65 | + android: true | ||
| 66 | + dotnet: false | ||
| 67 | + haskell: true | ||
| 68 | + large-packages: true | ||
| 69 | + docker-images: false | ||
| 70 | + swap-storage: true | ||
| 71 | + | ||
| 72 | + - name: Check space | ||
| 73 | + if: matrix.os == 'ubuntu-latest' | ||
| 74 | + shell: bash | ||
| 75 | + run: | | ||
| 76 | + df -h | ||
| 77 | + | ||
| 35 | - name: Setup .NET 6.0 | 78 | - name: Setup .NET 6.0 |
| 36 | uses: actions/setup-dotnet@v4 | 79 | uses: actions/setup-dotnet@v4 |
| 37 | with: | 80 | with: |
| @@ -47,6 +47,49 @@ jobs: | @@ -47,6 +47,49 @@ jobs: | ||
| 47 | with: | 47 | with: |
| 48 | fetch-depth: 0 | 48 | fetch-depth: 0 |
| 49 | 49 | ||
| 50 | + - name: Free space | ||
| 51 | + if: matrix.os == 'ubuntu-latest' | ||
| 52 | + shell: bash | ||
| 53 | + run: | | ||
| 54 | + df -h | ||
| 55 | + rm -rf /opt/hostedtoolcache | ||
| 56 | + df -h | ||
| 57 | + | ||
| 58 | + - name: Free more space | ||
| 59 | + if: matrix.os == 'ubuntu-latest' | ||
| 60 | + shell: bash | ||
| 61 | + run: | | ||
| 62 | + # https://github.com/orgs/community/discussions/25678 | ||
| 63 | + cd /opt | ||
| 64 | + find . -maxdepth 1 -mindepth 1 '!' -path ./containerd '!' -path ./actionarchivecache '!' -path ./runner '!' -path ./runner-cache -exec rm -rf '{}' ';' | ||
| 65 | + | ||
| 66 | + sudo rm -rf /usr/share/dotnet | ||
| 67 | + sudo rm -rf "/usr/local/share/boost" | ||
| 68 | + sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
| 69 | + | ||
| 70 | + - name: Free Disk Space (Ubuntu) | ||
| 71 | + if: matrix.os == 'ubuntu-latest' | ||
| 72 | + uses: jlumbroso/free-disk-space@main | ||
| 73 | + with: | ||
| 74 | + # this might remove tools that are actually needed, | ||
| 75 | + # if set to "true" but frees about 6 GB | ||
| 76 | + tool-cache: false | ||
| 77 | + | ||
| 78 | + # all of these default to true, but feel free to set to | ||
| 79 | + # "false" if necessary for your workflow | ||
| 80 | + android: true | ||
| 81 | + dotnet: false | ||
| 82 | + haskell: true | ||
| 83 | + large-packages: true | ||
| 84 | + docker-images: false | ||
| 85 | + swap-storage: true | ||
| 86 | + | ||
| 87 | + - name: Check space | ||
| 88 | + if: matrix.os == 'ubuntu-latest' | ||
| 89 | + shell: bash | ||
| 90 | + run: | | ||
| 91 | + df -h | ||
| 92 | + | ||
| 50 | - name: ccache | 93 | - name: ccache |
| 51 | uses: hendrikmuhs/ccache-action@v1.2 | 94 | uses: hendrikmuhs/ccache-action@v1.2 |
| 52 | with: | 95 | with: |
| 1 | +#!/usr/bin/env bash | ||
| 2 | + | ||
| 3 | +set -ex | ||
| 4 | + | ||
| 5 | +if [ ! -f ./large-v3-encoder.int8.onnx ]; then | ||
| 6 | + git lfs install | ||
| 7 | + | ||
| 8 | + git clone https://huggingface.co/csukuangfj/sherpa-onnx-whisper-large-v3 | ||
| 9 | + | ||
| 10 | + ls -lh sherpa-onnx-whisper-large-v3 | ||
| 11 | + cp -v sherpa-onnx-whisper-large-v3/*.onnx . | ||
| 12 | + cp -v sherpa-onnx-whisper-large-v3/*.weights . | ||
| 13 | + ls -lh | ||
| 14 | +fi | ||
| 15 | + | ||
| 16 | +dotnet run \ | ||
| 17 | + --num-threads=2 \ | ||
| 18 | + --whisper-encoder=./large-v3-encoder.int8.onnx \ | ||
| 19 | + --whisper-decoder=./large-v3-decoder.int8.onnx \ | ||
| 20 | + --tokens=./sherpa-onnx-whisper-large-v3/large-v3-tokens.txt \ | ||
| 21 | + --files ./sherpa-onnx-whisper-large-v3/test_wavs/0.wav \ | ||
| 22 | + ./sherpa-onnx-whisper-large-v3/test_wavs/1.wav \ | ||
| 23 | + ./sherpa-onnx-whisper-large-v3/test_wavs/8k.wav | ||
| 24 | + | ||
| 25 | +dotnet run \ | ||
| 26 | + --num-threads=2 \ | ||
| 27 | + --whisper-encoder=./large-v3-encoder.onnx \ | ||
| 28 | + --whisper-decoder=./large-v3-decoder.onnx \ | ||
| 29 | + --tokens=./sherpa-onnx-whisper-large-v3/large-v3-tokens.txt \ | ||
| 30 | + --files ./sherpa-onnx-whisper-large-v3/test_wavs/0.wav \ | ||
| 31 | + ./sherpa-onnx-whisper-large-v3/test_wavs/1.wav \ | ||
| 32 | + ./sherpa-onnx-whisper-large-v3/test_wavs/8k.wav |
-
请 注册 或 登录 后发表评论