Committed by
GitHub
Fix publishing apks to huggingface (#1121)
Save APKs for each release in a separate directory. Huggingface requires that each directory cannot contain more than 1000 files. Since we have so many tts models and for each model we need to build APKs of 4 different ABIs, it is a workaround for the huggingface's constraint by placing them into separate directories for different releases.
正在显示
36 个修改的文件
包含
123 行增加
和
60 行删除
| @@ -2,6 +2,8 @@ name: apk-asr-2pass | @@ -2,6 +2,8 @@ name: apk-asr-2pass | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -160,14 +162,19 @@ jobs: | @@ -160,14 +162,19 @@ jobs: | ||
| 160 | export GIT_LFS_SKIP_SMUDGE=1 | 162 | export GIT_LFS_SKIP_SMUDGE=1 |
| 161 | export GIT_CLONE_PROTECTION_ACTIVE=false | 163 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 162 | 164 | ||
| 165 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 166 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 167 | + | ||
| 163 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 168 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 164 | cd huggingface | 169 | cd huggingface |
| 165 | git fetch | 170 | git fetch |
| 166 | git pull | 171 | git pull |
| 167 | git merge -m "merge remote" --ff origin main | 172 | git merge -m "merge remote" --ff origin main |
| 168 | 173 | ||
| 169 | - mkdir -p asr-2pass | ||
| 170 | - cp -v ../apks/*.apk ./asr-2pass/ | 174 | + d=asr-2pass/$SHERPA_ONNX_VERSION |
| 175 | + mkdir -p $d | ||
| 176 | + | ||
| 177 | + cp -v ../apks/*.apk $d/ | ||
| 171 | git status | 178 | git status |
| 172 | git lfs track "*.apk" | 179 | git lfs track "*.apk" |
| 173 | git add . | 180 | git add . |
| @@ -2,6 +2,8 @@ name: apk-asr | @@ -2,6 +2,8 @@ name: apk-asr | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -160,14 +162,18 @@ jobs: | @@ -160,14 +162,18 @@ jobs: | ||
| 160 | export GIT_LFS_SKIP_SMUDGE=1 | 162 | export GIT_LFS_SKIP_SMUDGE=1 |
| 161 | export GIT_CLONE_PROTECTION_ACTIVE=false | 163 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 162 | 164 | ||
| 165 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 166 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 167 | + | ||
| 163 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 168 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 164 | cd huggingface | 169 | cd huggingface |
| 165 | git fetch | 170 | git fetch |
| 166 | git pull | 171 | git pull |
| 167 | git merge -m "merge remote" --ff origin main | 172 | git merge -m "merge remote" --ff origin main |
| 168 | 173 | ||
| 169 | - mkdir -p asr | ||
| 170 | - cp -v ../apks/*.apk ./asr/ | 174 | + d=asr/$SHERPA_ONNX_VERSION |
| 175 | + mkdir -p $d | ||
| 176 | + cp -v ../apks/*.apk $d/ | ||
| 171 | git status | 177 | git status |
| 172 | git lfs track "*.apk" | 178 | git lfs track "*.apk" |
| 173 | git add . | 179 | git add . |
| @@ -2,6 +2,8 @@ name: apk-audio-tagging-wearos | @@ -2,6 +2,8 @@ name: apk-audio-tagging-wearos | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -160,14 +162,18 @@ jobs: | @@ -160,14 +162,18 @@ jobs: | ||
| 160 | export GIT_LFS_SKIP_SMUDGE=1 | 162 | export GIT_LFS_SKIP_SMUDGE=1 |
| 161 | export GIT_CLONE_PROTECTION_ACTIVE=false | 163 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 162 | 164 | ||
| 165 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 166 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 167 | + | ||
| 163 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 168 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 164 | cd huggingface | 169 | cd huggingface |
| 165 | git fetch | 170 | git fetch |
| 166 | git pull | 171 | git pull |
| 167 | git merge -m "merge remote" --ff origin main | 172 | git merge -m "merge remote" --ff origin main |
| 168 | 173 | ||
| 169 | - mkdir -p audio-tagging-wearos | ||
| 170 | - cp -v ../apks/*.apk ./audio-tagging-wearos/ | 174 | + d=audio-tagging-wearos/$SHERPA_ONNX_VERSION |
| 175 | + mkdir -p $d | ||
| 176 | + cp -v ../apks/*.apk $d/ | ||
| 171 | git status | 177 | git status |
| 172 | git lfs track "*.apk" | 178 | git lfs track "*.apk" |
| 173 | git add . | 179 | git add . |
| @@ -2,6 +2,8 @@ name: apk-kws | @@ -2,6 +2,8 @@ name: apk-kws | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -157,14 +159,18 @@ jobs: | @@ -157,14 +159,18 @@ jobs: | ||
| 157 | export GIT_LFS_SKIP_SMUDGE=1 | 159 | export GIT_LFS_SKIP_SMUDGE=1 |
| 158 | export GIT_CLONE_PROTECTION_ACTIVE=false | 160 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 159 | 161 | ||
| 162 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 163 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 164 | + | ||
| 160 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 165 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 161 | cd huggingface | 166 | cd huggingface |
| 162 | git fetch | 167 | git fetch |
| 163 | git pull | 168 | git pull |
| 164 | git merge -m "merge remote" --ff origin main | 169 | git merge -m "merge remote" --ff origin main |
| 165 | 170 | ||
| 166 | - mkdir -p kws | ||
| 167 | - cp -v ../apks/*.apk ./kws/ | 171 | + d=kws/$SHERPA_ONNX_VERSION |
| 172 | + mkdir -p $d | ||
| 173 | + cp -v ../apks/*.apk $d/ | ||
| 168 | git status | 174 | git status |
| 169 | git lfs track "*.apk" | 175 | git lfs track "*.apk" |
| 170 | git add . | 176 | git add . |
| @@ -2,6 +2,8 @@ name: apk-speaker-identification | @@ -2,6 +2,8 @@ name: apk-speaker-identification | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -98,14 +100,18 @@ jobs: | @@ -98,14 +100,18 @@ jobs: | ||
| 98 | export GIT_LFS_SKIP_SMUDGE=1 | 100 | export GIT_LFS_SKIP_SMUDGE=1 |
| 99 | export GIT_CLONE_PROTECTION_ACTIVE=false | 101 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 100 | 102 | ||
| 103 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 104 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 105 | + | ||
| 101 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 106 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 102 | cd huggingface | 107 | cd huggingface |
| 103 | git fetch | 108 | git fetch |
| 104 | git pull | 109 | git pull |
| 105 | git merge -m "merge remote" --ff origin main | 110 | git merge -m "merge remote" --ff origin main |
| 106 | 111 | ||
| 107 | - mkdir -p speaker-identification | ||
| 108 | - cp -v ../apks/*.apk ./speaker-identification/ | 112 | + d=speaker-identification/$SHERPA_ONNX_VERSION |
| 113 | + mkdir -p $d/ | ||
| 114 | + cp -v ../apks/*.apk $d/ | ||
| 109 | git status | 115 | git status |
| 110 | git lfs track "*.apk" | 116 | git lfs track "*.apk" |
| 111 | git add . | 117 | git add . |
| @@ -2,6 +2,8 @@ name: apk-slid | @@ -2,6 +2,8 @@ name: apk-slid | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -160,14 +162,18 @@ jobs: | @@ -160,14 +162,18 @@ jobs: | ||
| 160 | export GIT_LFS_SKIP_SMUDGE=1 | 162 | export GIT_LFS_SKIP_SMUDGE=1 |
| 161 | export GIT_CLONE_PROTECTION_ACTIVE=false | 163 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 162 | 164 | ||
| 165 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 166 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 167 | + | ||
| 163 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 168 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 164 | cd huggingface | 169 | cd huggingface |
| 165 | git fetch | 170 | git fetch |
| 166 | git pull | 171 | git pull |
| 167 | git merge -m "merge remote" --ff origin main | 172 | git merge -m "merge remote" --ff origin main |
| 168 | 173 | ||
| 169 | - mkdir -p slid | ||
| 170 | - cp -v ../apks/*.apk ./slid/ | 174 | + d=slid/$SHERPA_ONNX_VERSION |
| 175 | + mkdir -p $d/ | ||
| 176 | + cp -v ../apks/*.apk $d/ | ||
| 171 | git status | 177 | git status |
| 172 | git lfs track "*.apk" | 178 | git lfs track "*.apk" |
| 173 | git add . | 179 | git add . |
| @@ -2,6 +2,8 @@ name: apk-tts-engine | @@ -2,6 +2,8 @@ name: apk-tts-engine | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -161,14 +163,18 @@ jobs: | @@ -161,14 +163,18 @@ jobs: | ||
| 161 | export GIT_LFS_SKIP_SMUDGE=1 | 163 | export GIT_LFS_SKIP_SMUDGE=1 |
| 162 | export GIT_CLONE_PROTECTION_ACTIVE=false | 164 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 163 | 165 | ||
| 166 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 167 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 168 | + | ||
| 164 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 169 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 165 | cd huggingface | 170 | cd huggingface |
| 166 | git fetch | 171 | git fetch |
| 167 | git pull | 172 | git pull |
| 168 | git merge -m "merge remote" --ff origin main | 173 | git merge -m "merge remote" --ff origin main |
| 169 | 174 | ||
| 170 | - mkdir -p tts-engine-2 | ||
| 171 | - cp -v ../apks/*.apk ./tts-engine-2/ | 175 | + d=tts-engine-new/$SHERPA_ONNX_VERSION |
| 176 | + mkdir -p $d | ||
| 177 | + cp -v ../apks/*.apk $d/ | ||
| 172 | git status | 178 | git status |
| 173 | git lfs track "*.apk" | 179 | git lfs track "*.apk" |
| 174 | git add . | 180 | git add . |
| @@ -2,6 +2,8 @@ name: apk-tts | @@ -2,6 +2,8 @@ name: apk-tts | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -161,14 +163,18 @@ jobs: | @@ -161,14 +163,18 @@ jobs: | ||
| 161 | export GIT_LFS_SKIP_SMUDGE=1 | 163 | export GIT_LFS_SKIP_SMUDGE=1 |
| 162 | export GIT_CLONE_PROTECTION_ACTIVE=false | 164 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 163 | 165 | ||
| 166 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 167 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 168 | + | ||
| 164 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 169 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 165 | cd huggingface | 170 | cd huggingface |
| 166 | git fetch | 171 | git fetch |
| 167 | git pull | 172 | git pull |
| 168 | git merge -m "merge remote" --ff origin main | 173 | git merge -m "merge remote" --ff origin main |
| 169 | 174 | ||
| 170 | - mkdir -p tts-2 | ||
| 171 | - cp -v ../apks/*.apk ./tts-2/ | 175 | + d=tts-new/$SHERPA_ONNX_VERSION |
| 176 | + mkdir -p $d | ||
| 177 | + cp -v ../apks/*.apk $d/ | ||
| 172 | git status | 178 | git status |
| 173 | git lfs track "*.apk" | 179 | git lfs track "*.apk" |
| 174 | git add . | 180 | git add . |
| @@ -2,6 +2,8 @@ name: apk-vad-asr | @@ -2,6 +2,8 @@ name: apk-vad-asr | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -160,14 +162,18 @@ jobs: | @@ -160,14 +162,18 @@ jobs: | ||
| 160 | export GIT_LFS_SKIP_SMUDGE=1 | 162 | export GIT_LFS_SKIP_SMUDGE=1 |
| 161 | export GIT_CLONE_PROTECTION_ACTIVE=false | 163 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 162 | 164 | ||
| 165 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 166 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 167 | + | ||
| 163 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 168 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 164 | cd huggingface | 169 | cd huggingface |
| 165 | git fetch | 170 | git fetch |
| 166 | git pull | 171 | git pull |
| 167 | git merge -m "merge remote" --ff origin main | 172 | git merge -m "merge remote" --ff origin main |
| 168 | 173 | ||
| 169 | - mkdir -p vad-asr | ||
| 170 | - cp -v ../apks/*.apk ./vad-asr/ | 174 | + d=vad-asr/$SHERPA_ONNX_VERSION |
| 175 | + mkdir -p $d | ||
| 176 | + cp -v ../apks/*.apk $d/ | ||
| 171 | git status | 177 | git status |
| 172 | git lfs track "*.apk" | 178 | git lfs track "*.apk" |
| 173 | git add . | 179 | git add . |
| @@ -2,6 +2,8 @@ name: apk-vad | @@ -2,6 +2,8 @@ name: apk-vad | ||
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | + branches: | ||
| 6 | + - apk | ||
| 5 | tags: | 7 | tags: |
| 6 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 8 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 7 | 9 | ||
| @@ -157,14 +159,18 @@ jobs: | @@ -157,14 +159,18 @@ jobs: | ||
| 157 | export GIT_LFS_SKIP_SMUDGE=1 | 159 | export GIT_LFS_SKIP_SMUDGE=1 |
| 158 | export GIT_CLONE_PROTECTION_ACTIVE=false | 160 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 159 | 161 | ||
| 162 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 163 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 164 | + | ||
| 160 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface | 165 | git clone https://huggingface.co/csukuangfj/sherpa-onnx-apk huggingface |
| 161 | cd huggingface | 166 | cd huggingface |
| 162 | git fetch | 167 | git fetch |
| 163 | git pull | 168 | git pull |
| 164 | git merge -m "merge remote" --ff origin main | 169 | git merge -m "merge remote" --ff origin main |
| 165 | 170 | ||
| 166 | - mkdir -p vad | ||
| 167 | - cp -v ../apks/*.apk ./vad/ | 171 | + d=vad/SHERPA_ONNX_VERSION |
| 172 | + mkdir -p $d | ||
| 173 | + cp -v ../apks/*.apk $d/ | ||
| 168 | git status | 174 | git status |
| 169 | git lfs track "*.apk" | 175 | git lfs track "*.apk" |
| 170 | git add . | 176 | git add . |
| @@ -15,7 +15,7 @@ func main() { | @@ -15,7 +15,7 @@ func main() { | ||
| 15 | config := sherpa.VadModelConfig{} | 15 | config := sherpa.VadModelConfig{} |
| 16 | 16 | ||
| 17 | // Please download silero_vad.onnx from | 17 | // Please download silero_vad.onnx from |
| 18 | - // https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 18 | + // https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 19 | 19 | ||
| 20 | config.SileroVad.Model = "./silero_vad.onnx" | 20 | config.SileroVad.Model = "./silero_vad.onnx" |
| 21 | config.SileroVad.Threshold = 0.5 | 21 | config.SileroVad.Threshold = 0.5 |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | set -ex | 3 | set -ex |
| 4 | 4 | ||
| 5 | if [ ! -f ./silero_vad.onnx ]; then | 5 | if [ ! -f ./silero_vad.onnx ]; then |
| 6 | - curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 6 | + curl -SL -O https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 7 | fi | 7 | fi |
| 8 | 8 | ||
| 9 | if [ ! -f ./sherpa-onnx-paraformer-trilingual-zh-cantonese-en/model.int8.onnx ]; then | 9 | if [ ! -f ./sherpa-onnx-paraformer-trilingual-zh-cantonese-en/model.int8.onnx ]; then |
| @@ -15,7 +15,7 @@ func main() { | @@ -15,7 +15,7 @@ func main() { | ||
| 15 | config := sherpa.VadModelConfig{} | 15 | config := sherpa.VadModelConfig{} |
| 16 | 16 | ||
| 17 | // Please download silero_vad.onnx from | 17 | // Please download silero_vad.onnx from |
| 18 | - // https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 18 | + // https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 19 | 19 | ||
| 20 | config.SileroVad.Model = "./silero_vad.onnx" | 20 | config.SileroVad.Model = "./silero_vad.onnx" |
| 21 | config.SileroVad.Threshold = 0.5 | 21 | config.SileroVad.Threshold = 0.5 |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | set -ex | 3 | set -ex |
| 4 | 4 | ||
| 5 | if [ ! -f ./silero_vad.onnx ]; then | 5 | if [ ! -f ./silero_vad.onnx ]; then |
| 6 | - curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 6 | + curl -SL -O https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 7 | fi | 7 | fi |
| 8 | 8 | ||
| 9 | if [ ! -f ./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.int8.onnx ]; then | 9 | if [ ! -f ./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.int8.onnx ]; then |
| @@ -89,7 +89,7 @@ func createVad() *sherpa.VoiceActivityDetector { | @@ -89,7 +89,7 @@ func createVad() *sherpa.VoiceActivityDetector { | ||
| 89 | config := sherpa.VadModelConfig{} | 89 | config := sherpa.VadModelConfig{} |
| 90 | 90 | ||
| 91 | // Please download silero_vad.onnx from | 91 | // Please download silero_vad.onnx from |
| 92 | - // https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 92 | + // https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 93 | 93 | ||
| 94 | config.SileroVad.Model = "./silero_vad.onnx" | 94 | config.SileroVad.Model = "./silero_vad.onnx" |
| 95 | config.SileroVad.Threshold = 0.5 | 95 | config.SileroVad.Threshold = 0.5 |
| @@ -11,7 +11,7 @@ if [ ! -f ./sr-data/enroll/fangjun-sr-1.wav ]; then | @@ -11,7 +11,7 @@ if [ ! -f ./sr-data/enroll/fangjun-sr-1.wav ]; then | ||
| 11 | fi | 11 | fi |
| 12 | 12 | ||
| 13 | if [ ! -f ./silero_vad.onnx ]; then | 13 | if [ ! -f ./silero_vad.onnx ]; then |
| 14 | - curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 14 | + curl -SL -O https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 15 | fi | 15 | fi |
| 16 | 16 | ||
| 17 | go mod tidy | 17 | go mod tidy |
| @@ -15,7 +15,7 @@ func main() { | @@ -15,7 +15,7 @@ func main() { | ||
| 15 | config := sherpa.VadModelConfig{} | 15 | config := sherpa.VadModelConfig{} |
| 16 | 16 | ||
| 17 | // Please download silero_vad.onnx from | 17 | // Please download silero_vad.onnx from |
| 18 | - // https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 18 | + // https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 19 | 19 | ||
| 20 | config.SileroVad.Model = "./silero_vad.onnx" | 20 | config.SileroVad.Model = "./silero_vad.onnx" |
| 21 | config.SileroVad.Threshold = 0.5 | 21 | config.SileroVad.Threshold = 0.5 |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | set -ex | 3 | set -ex |
| 4 | 4 | ||
| 5 | if [ ! -f ./silero_vad.onnx ]; then | 5 | if [ ! -f ./silero_vad.onnx ]; then |
| 6 | - curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 6 | + curl -SL -O https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 7 | fi | 7 | fi |
| 8 | 8 | ||
| 9 | if [ ! -f ./sherpa-onnx-whisper-tiny/tiny-encoder.int8.onnx ]; then | 9 | if [ ! -f ./sherpa-onnx-whisper-tiny/tiny-encoder.int8.onnx ]; then |
| @@ -13,7 +13,7 @@ func main() { | @@ -13,7 +13,7 @@ func main() { | ||
| 13 | config := sherpa.VadModelConfig{} | 13 | config := sherpa.VadModelConfig{} |
| 14 | 14 | ||
| 15 | // Please download silero_vad.onnx from | 15 | // Please download silero_vad.onnx from |
| 16 | - // https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 16 | + // https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 17 | 17 | ||
| 18 | config.SileroVad.Model = "./silero_vad.onnx" | 18 | config.SileroVad.Model = "./silero_vad.onnx" |
| 19 | config.SileroVad.Threshold = 0.5 | 19 | config.SileroVad.Threshold = 0.5 |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | set -ex | 3 | set -ex |
| 4 | 4 | ||
| 5 | if [ ! -f ./silero_vad.onnx ]; then | 5 | if [ ! -f ./silero_vad.onnx ]; then |
| 6 | - curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 6 | + curl -SL -O https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 7 | fi | 7 | fi |
| 8 | 8 | ||
| 9 | go mod tidy | 9 | go mod tidy |
| @@ -12,12 +12,12 @@ Supported file formats are those supported by ffmpeg; for instance, | @@ -12,12 +12,12 @@ Supported file formats are those supported by ffmpeg; for instance, | ||
| 12 | Note that you need a non-streaming model for this script. | 12 | Note that you need a non-streaming model for this script. |
| 13 | 13 | ||
| 14 | Please visit | 14 | Please visit |
| 15 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 15 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 16 | to download silero_vad.onnx | 16 | to download silero_vad.onnx |
| 17 | 17 | ||
| 18 | For instance, | 18 | For instance, |
| 19 | 19 | ||
| 20 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 20 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 21 | 21 | ||
| 22 | (1) For paraformer | 22 | (1) For paraformer |
| 23 | 23 | ||
| @@ -386,7 +386,7 @@ def main(): | @@ -386,7 +386,7 @@ def main(): | ||
| 386 | 386 | ||
| 387 | print("Started!") | 387 | print("Started!") |
| 388 | 388 | ||
| 389 | - is_silence=False | 389 | + is_silence = False |
| 390 | # TODO(fangjun): Support multithreads | 390 | # TODO(fangjun): Support multithreads |
| 391 | while True: | 391 | while True: |
| 392 | # *2 because int16_t has two bytes | 392 | # *2 because int16_t has two bytes |
| @@ -394,9 +394,9 @@ def main(): | @@ -394,9 +394,9 @@ def main(): | ||
| 394 | if not data: | 394 | if not data: |
| 395 | if is_silence: | 395 | if is_silence: |
| 396 | break | 396 | break |
| 397 | - is_silence=True | 397 | + is_silence = True |
| 398 | # The converted audio file does not have a mute data of 1 second or more at the end, which will result in the loss of the last segment data | 398 | # The converted audio file does not have a mute data of 1 second or more at the end, which will result in the loss of the last segment data |
| 399 | - data = np.zeros(1*args.sample_rate,dtype=np.int16) | 399 | + data = np.zeros(1 * args.sample_rate, dtype=np.int16) |
| 400 | 400 | ||
| 401 | samples = np.frombuffer(data, dtype=np.int16) | 401 | samples = np.frombuffer(data, dtype=np.int16) |
| 402 | samples = samples.astype(np.float32) / 32768 | 402 | samples = samples.astype(np.float32) / 32768 |
| @@ -18,12 +18,12 @@ Note that `zh` means Chinese, while `en` means English. | @@ -18,12 +18,12 @@ Note that `zh` means Chinese, while `en` means English. | ||
| 18 | 18 | ||
| 19 | (2) Download the VAD model | 19 | (2) Download the VAD model |
| 20 | Please visit | 20 | Please visit |
| 21 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 21 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 22 | to download silero_vad.onnx | 22 | to download silero_vad.onnx |
| 23 | 23 | ||
| 24 | For instance, | 24 | For instance, |
| 25 | 25 | ||
| 26 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 26 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 27 | 27 | ||
| 28 | (3) Run this script | 28 | (3) Run this script |
| 29 | 29 |
| @@ -38,12 +38,12 @@ Note that `zh` means Chinese, while `en` means English. | @@ -38,12 +38,12 @@ Note that `zh` means Chinese, while `en` means English. | ||
| 38 | 38 | ||
| 39 | (3) Download the VAD model | 39 | (3) Download the VAD model |
| 40 | Please visit | 40 | Please visit |
| 41 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 41 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 42 | to download silero_vad.onnx | 42 | to download silero_vad.onnx |
| 43 | 43 | ||
| 44 | For instance, | 44 | For instance, |
| 45 | 45 | ||
| 46 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 46 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 47 | 47 | ||
| 48 | (4) Please refer to ./generate-subtitles.py | 48 | (4) Please refer to ./generate-subtitles.py |
| 49 | to download a non-streaming ASR model. | 49 | to download a non-streaming ASR model. |
| @@ -36,12 +36,12 @@ Note that `zh` means Chinese, while `en` means English. | @@ -36,12 +36,12 @@ Note that `zh` means Chinese, while `en` means English. | ||
| 36 | 36 | ||
| 37 | (3) Download the VAD model | 37 | (3) Download the VAD model |
| 38 | Please visit | 38 | Please visit |
| 39 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 39 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 40 | to download silero_vad.onnx | 40 | to download silero_vad.onnx |
| 41 | 41 | ||
| 42 | For instance, | 42 | For instance, |
| 43 | 43 | ||
| 44 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 44 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 45 | 45 | ||
| 46 | (4) Run this script | 46 | (4) Run this script |
| 47 | 47 |
| @@ -55,7 +55,7 @@ def main(): | @@ -55,7 +55,7 @@ def main(): | ||
| 55 | if not Path(args.silero_vad_model).is_file(): | 55 | if not Path(args.silero_vad_model).is_file(): |
| 56 | raise RuntimeError( | 56 | raise RuntimeError( |
| 57 | f"{args.silero_vad_model} does not exist. Please download it from " | 57 | f"{args.silero_vad_model} does not exist. Please download it from " |
| 58 | - "https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx" | 58 | + "https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx" |
| 59 | ) | 59 | ) |
| 60 | 60 | ||
| 61 | device_name = args.device_name | 61 | device_name = args.device_name |
| @@ -38,7 +38,7 @@ def main(): | @@ -38,7 +38,7 @@ def main(): | ||
| 38 | if not Path(args.silero_vad_model).is_file(): | 38 | if not Path(args.silero_vad_model).is_file(): |
| 39 | raise RuntimeError( | 39 | raise RuntimeError( |
| 40 | f"{args.silero_vad_model} does not exist. Please download it from " | 40 | f"{args.silero_vad_model} does not exist. Please download it from " |
| 41 | - "https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx" | 41 | + "https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx" |
| 42 | ) | 42 | ) |
| 43 | 43 | ||
| 44 | mic_sample_rate = 16000 | 44 | mic_sample_rate = 16000 |
| @@ -14,12 +14,12 @@ python3 ./vad-remove-non-speech-segments-alsa.py \ | @@ -14,12 +14,12 @@ python3 ./vad-remove-non-speech-segments-alsa.py \ | ||
| 14 | --silero-vad-model silero_vad.onnx | 14 | --silero-vad-model silero_vad.onnx |
| 15 | 15 | ||
| 16 | Please visit | 16 | Please visit |
| 17 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 17 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 18 | to download silero_vad.onnx | 18 | to download silero_vad.onnx |
| 19 | 19 | ||
| 20 | For instance, | 20 | For instance, |
| 21 | 21 | ||
| 22 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 22 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 23 | """ | 23 | """ |
| 24 | 24 | ||
| 25 | import argparse | 25 | import argparse |
| @@ -13,12 +13,12 @@ python3 ./vad-remove-non-speech-segments-from-file.py \ | @@ -13,12 +13,12 @@ python3 ./vad-remove-non-speech-segments-from-file.py \ | ||
| 13 | output.wav | 13 | output.wav |
| 14 | 14 | ||
| 15 | Please visit | 15 | Please visit |
| 16 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 16 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 17 | to download silero_vad.onnx | 17 | to download silero_vad.onnx |
| 18 | 18 | ||
| 19 | For instance, | 19 | For instance, |
| 20 | 20 | ||
| 21 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 21 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 22 | """ | 22 | """ |
| 23 | 23 | ||
| 24 | import argparse | 24 | import argparse |
| @@ -11,12 +11,12 @@ python3 ./vad-remove-non-speech-segments.py \ | @@ -11,12 +11,12 @@ python3 ./vad-remove-non-speech-segments.py \ | ||
| 11 | --silero-vad-model silero_vad.onnx | 11 | --silero-vad-model silero_vad.onnx |
| 12 | 12 | ||
| 13 | Please visit | 13 | Please visit |
| 14 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 14 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 15 | to download silero_vad.onnx | 15 | to download silero_vad.onnx |
| 16 | 16 | ||
| 17 | For instance, | 17 | For instance, |
| 18 | 18 | ||
| 19 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 19 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 20 | """ | 20 | """ |
| 21 | 21 | ||
| 22 | import argparse | 22 | import argparse |
| @@ -51,12 +51,12 @@ to install sherpa-onnx and to download non-streaming pre-trained models | @@ -51,12 +51,12 @@ to install sherpa-onnx and to download non-streaming pre-trained models | ||
| 51 | used in this file. | 51 | used in this file. |
| 52 | 52 | ||
| 53 | Please visit | 53 | Please visit |
| 54 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 54 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 55 | to download silero_vad.onnx | 55 | to download silero_vad.onnx |
| 56 | 56 | ||
| 57 | For instance, | 57 | For instance, |
| 58 | 58 | ||
| 59 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 59 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 60 | """ | 60 | """ |
| 61 | import argparse | 61 | import argparse |
| 62 | import sys | 62 | import sys |
| @@ -32,11 +32,11 @@ log "====================x86====================" | @@ -32,11 +32,11 @@ log "====================x86====================" | ||
| 32 | 32 | ||
| 33 | mkdir -p apks | 33 | mkdir -p apks |
| 34 | 34 | ||
| 35 | -log "https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx" | 35 | +log "https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx" |
| 36 | 36 | ||
| 37 | # Download the model | 37 | # Download the model |
| 38 | pushd ./android/SherpaOnnxVad/app/src/main/assets/ | 38 | pushd ./android/SherpaOnnxVad/app/src/main/assets/ |
| 39 | -wget -c https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 39 | +wget -c https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 40 | popd | 40 | popd |
| 41 | 41 | ||
| 42 | for arch in arm64-v8a armeabi-v7a x86_64 x86; do | 42 | for arch in arm64-v8a armeabi-v7a x86_64 x86; do |
| @@ -30,10 +30,10 @@ This program shows how to use VAD in sherpa-onnx. | @@ -30,10 +30,10 @@ This program shows how to use VAD in sherpa-onnx. | ||
| 30 | device_name | 30 | device_name |
| 31 | 31 | ||
| 32 | Please download silero_vad.onnx from | 32 | Please download silero_vad.onnx from |
| 33 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 33 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 34 | 34 | ||
| 35 | For instance, use | 35 | For instance, use |
| 36 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 36 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 37 | 37 | ||
| 38 | The device name specifies which microphone to use in case there are several | 38 | The device name specifies which microphone to use in case there are several |
| 39 | on your system. You can use | 39 | on your system. You can use |
| @@ -45,10 +45,10 @@ This program shows how to use a streaming VAD with non-streaming ASR in | @@ -45,10 +45,10 @@ This program shows how to use a streaming VAD with non-streaming ASR in | ||
| 45 | sherpa-onnx. | 45 | sherpa-onnx. |
| 46 | 46 | ||
| 47 | Please download silero_vad.onnx from | 47 | Please download silero_vad.onnx from |
| 48 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 48 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 49 | 49 | ||
| 50 | For instance, use | 50 | For instance, use |
| 51 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 51 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 52 | 52 | ||
| 53 | Please refer to ./sherpa-onnx-microphone-offline.cc | 53 | Please refer to ./sherpa-onnx-microphone-offline.cc |
| 54 | to download models for offline ASR. | 54 | to download models for offline ASR. |
| @@ -49,10 +49,10 @@ This program shows how to use VAD in sherpa-onnx. | @@ -49,10 +49,10 @@ This program shows how to use VAD in sherpa-onnx. | ||
| 49 | --vad-num-threads=1 | 49 | --vad-num-threads=1 |
| 50 | 50 | ||
| 51 | Please download silero_vad.onnx from | 51 | Please download silero_vad.onnx from |
| 52 | -https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 52 | +https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 53 | 53 | ||
| 54 | For instance, use | 54 | For instance, use |
| 55 | -wget https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx | 55 | +wget https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 56 | )usage"; | 56 | )usage"; |
| 57 | 57 | ||
| 58 | sherpa_onnx::ParseOptions po(kUsageMessage); | 58 | sherpa_onnx::ParseOptions po(kUsageMessage); |
| @@ -82,7 +82,7 @@ class Vad( | @@ -82,7 +82,7 @@ class Vad( | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | // Please visit | 84 | // Please visit |
| 85 | -// https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx | 85 | +// https://github.com/snakers4/silero-vad/raw/master/src/silero_vad/data/silero_vad.onnx |
| 86 | // to download silero_vad.onnx | 86 | // to download silero_vad.onnx |
| 87 | // and put it inside the assets/ | 87 | // and put it inside the assets/ |
| 88 | // directory | 88 | // directory |
-
请 注册 或 登录 后发表评论