Skip to content

Commit

Permalink
disable converting to ort
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Dec 7, 2023
1 parent 9e9ea0f commit 2bf2530
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
26 changes: 2 additions & 24 deletions .github/scripts/test-offline-whisper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ for name in ${names[@]}; do
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
pushd $repo
git lfs pull --include "*.onnx"
git lfs pull --include "*.ort"
ls -lh *.{onnx,ort}
# git lfs pull --include "*.ort"
ls -lh *.onnx
popd

log "test fp32 onnx"
Expand All @@ -63,27 +63,5 @@ for name in ${names[@]}; do
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav

log "test fp32 ort"

time $EXE \
--tokens=$repo/${name}-tokens.txt \
--whisper-encoder=$repo/${name}-encoder.ort \
--whisper-decoder=$repo/${name}-decoder.ort \
--num-threads=2 \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav

log "test int8 ort"

time $EXE \
--tokens=$repo/${name}-tokens.txt \
--whisper-encoder=$repo/${name}-encoder.int8.ort \
--whisper-decoder=$repo/${name}-decoder.int8.ort \
--num-threads=2 \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav

rm -rf $repo
done
14 changes: 8 additions & 6 deletions .github/workflows/export-whisper-to-onnx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
ls -lh
fi
python3 ./export-onnx.py --model ${{ matrix.model }}
python3 -m onnxruntime.tools.convert_onnx_models_to_ort --optimization_style=Fixed ./
# python3 -m onnxruntime.tools.convert_onnx_models_to_ort --optimization_style=Fixed ./
ls -lh
Expand All @@ -65,15 +65,17 @@ jobs:
git config --global user.name "Fangjun Kuang"
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-whisper-${{ matrix.model }} huggingface
rm huggingface/*.onnx
rm huggingface/*.ort
cp *.onnx ./huggingface
cp *.ort ./huggingface
cp *tokens.txt ./huggingface
cp -v *.onnx ./huggingface
# cp *.ort ./huggingface
cp -v *tokens.txt ./huggingface
cd huggingface
if [[ $model == distil-medium.en ]]; then
mkdir test_wavs
mkdir -p test_wavs
cd test_wavs
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-whisper-medium.en/resolve/main/test_wavs/0.wav
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-whisper-medium.en/resolve/main/test_wavs/1.wav
Expand All @@ -86,7 +88,7 @@ jobs:
git status
ls -lh
git lfs track "*.onnx"
git lfs track "*.ort"
# git lfs track "*.ort"
git add .
git commit -m "upload ${{ matrix.model }}"
git push https://csukuangfj:[email protected]/csukuangfj/sherpa-onnx-whisper-${{ matrix.model }} main

0 comments on commit 2bf2530

Please sign in to comment.