Skip to content

Commit

Permalink
Add two-pass ASR Android APKs for Moonshine models. (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Oct 31, 2024
1 parent 9fa3bc4 commit a3c89aa
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/apk-asr-2pass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
total: ["2"]
index: ["0", "1"]
total: ["4"]
index: ["0", "1", "2", "3"]

steps:
- uses: actions/checkout@v4
Expand Down
38 changes: 38 additions & 0 deletions scripts/apk/generate-asr-2pass-apk-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,36 @@ def get_2nd_models():
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-moonshine-tiny-en-int8",
idx=21,
lang="en",
short_name="moonshine_tiny_int8",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-moonshine-base-en-int8",
idx=22,
lang="en",
short_name="moonshine_base_int8",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Expand Down Expand Up @@ -300,6 +330,14 @@ def get_models():
"sherpa-onnx-streaming-zipformer-en-20M-2023-02-17",
"sherpa-onnx-whisper-tiny.en",
),
(
"sherpa-onnx-streaming-zipformer-en-20M-2023-02-17",
"sherpa-onnx-moonshine-tiny-en-int8",
),
(
"sherpa-onnx-streaming-zipformer-en-20M-2023-02-17",
"sherpa-onnx-moonshine-base-en-int8",
),
(
"sherpa-onnx-streaming-zipformer-en-20M-2023-02-17",
"sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17",
Expand Down
15 changes: 15 additions & 0 deletions scripts/apk/generate-vad-asr-apk-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,21 @@ def get_models():
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-moonshine-base-en-int8",
idx=22,
lang="en",
short_name="moonshine_base_int8",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Expand Down
13 changes: 13 additions & 0 deletions sherpa-onnx/kotlin-api/OfflineRecognizer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,19 @@ fun getOfflineModelConfig(type: Int): OfflineModelConfig? {
tokens = "$modelDir/tokens.txt",
)
}

22 -> {
val modelDir = "sherpa-onnx-moonshine-base-en-int8"
return OfflineModelConfig(
moonshine = OfflineMoonshineModelConfig(
preprocessor = "$modelDir/preprocess.onnx",
encoder = "$modelDir/encode.int8.onnx",
uncachedDecoder = "$modelDir/uncached_decode.int8.onnx",
cachedDecoder = "$modelDir/cached_decode.int8.onnx",
),
tokens = "$modelDir/tokens.txt",
)
}
}
return null
}

0 comments on commit a3c89aa

Please sign in to comment.