Skip to content

Commit

Permalink
Fix whisper test script for the latest onnxruntime.
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Dec 20, 2023
1 parent 03ff9db commit f37a75e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/export-whisper-to-onnx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ jobs:
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
tag: asr-models

- name: Test tiny.en
if: matrix.model == 'tiny.en'
shell: bash
run: |
src=sherpa-onnx-whisper-tiny.en
python3 srcipts/whisper/test.py \
--encoder $src/tiny.en-encoder.int8.onnx \
--decoder $src/tiny.en-decoder.int8.onnx \
--tokens $src/tiny.en-tokens.txt \
$src/test_wavs/0.wav
- name: Publish ${{ matrix.model }} to huggingface
shell: bash
env:
Expand Down
4 changes: 2 additions & 2 deletions build-apk-two-pass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ git lfs pull --include "*.onnx"

# remove .git to save spaces
rm -rf .git
rm README.md
rm -fv README.md
rm -rf test_wavs
rm .gitattributes

rm *.ort
rm -fv *.ort
rm tiny.en-encoder.onnx
rm tiny.en-decoder.onnx

Expand Down
2 changes: 2 additions & 0 deletions scripts/whisper/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def init_encoder(self, encoder: str):
self.encoder = ort.InferenceSession(
encoder,
sess_options=self.session_opts,
providers=["CPUExecutionProvider"],
)

meta = self.encoder.get_modelmeta().custom_metadata_map
Expand Down Expand Up @@ -113,6 +114,7 @@ def init_decoder(self, decoder: str):
self.decoder = ort.InferenceSession(
decoder,
sess_options=self.session_opts,
providers=["CPUExecutionProvider"],
)

def run_encoder(
Expand Down

0 comments on commit f37a75e

Please sign in to comment.