Skip to content

Commit

Permalink
Support Revai/reverb-diarization-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Dec 15, 2024
1 parent e011e84 commit 248ae7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/export-revai-segmentation-to-onnx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
os: [macos-latest]
python-version: ["3.10"]
model_version: [v1,, v2]

steps:
- uses: actions/checkout@v4
Expand All @@ -34,7 +35,9 @@ jobs:
- name: Run
shell: bash
run: |
d=sherpa-onnx-reverb-diarization-v1
v=${{ matrix.model_version }}
export VERSION=$v
d=sherpa-onnx-reverb-diarization-$v
src=$PWD/$d
mkdir -p $src
Expand Down Expand Up @@ -72,7 +75,10 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Fangjun Kuang"
d=sherpa-onnx-reverb-diarization-v1
v=${{ matrix.model_version }}
export VERSION=$v
d=sherpa-onnx-reverb-diarization-$v
export GIT_LFS_SKIP_SMUDGE=1
export GIT_CLONE_PROTECTION_ACTIVE=false
git clone https://csukuangfj:[email protected]/csukuangfj/$d huggingface
Expand Down
10 changes: 7 additions & 3 deletions scripts/pyannote/segmentation/run-revai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@

export SHERPA_ONNX_IS_REVAI=1

if [ -z $VERSION ]; then
VERSION=v1
fi

set -ex
function install_pyannote() {
pip install pyannote.audio onnx onnxruntime
}

function download_test_files() {
curl -SL -O https://huggingface.co/Revai/reverb-diarization-v1/resolve/main/pytorch_model.bin
curl -SL -O https://huggingface.co/Revai/reverb-diarization-$VERSION/resolve/main/pytorch_model.bin
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/lei-jun-test.wav
}

Expand All @@ -28,13 +32,13 @@ echo "----------onnx model.onnx----------"
echo "----------onnx model.int8.onnx----------"
./vad-onnx.py --model ./model.int8.onnx --wav ./lei-jun-test.wav

curl -SL -O https://huggingface.co/Revai/reverb-diarization-v1/resolve/main/LICENSE
curl -SL -O https://huggingface.co/Revai/reverb-diarization-$VERSION/resolve/main/LICENSE

cat >README.md << EOF
# Introduction
Models in this file are converted from
https://huggingface.co/Revai/reverb-diarization-v1/tree/main
https://huggingface.co/Revai/reverb-diarization-$VERSION/tree/main
Note that it is accessible under a non-commercial license.
Expand Down

0 comments on commit 248ae7c

Please sign in to comment.