Skip to content

Commit

Permalink
add apk for offline nemo ctc models
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed May 12, 2024
1 parent 9049bb5 commit 99ed16c
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/apk-vad-asr.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: ["3"]
index: ["0", "1", "2"]
total: ["5"]
index: ["0", "1", "2", "3", "4"]

steps:
- uses: actions/checkout@v4
Expand Down
60 changes: 60 additions & 0 deletions scripts/apk/generate-vad-asr-apk-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,66 @@ def get_models():
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-nemo-fast-conformer-ctc-be-de-en-es-fr-hr-it-pl-ru-uk-20k",
idx=7,
lang="be_de_en_es_fr_hr_it_pl_ru_uk",
short_name="fast_conformer_ctc_20k",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-nemo-fast-conformer-ctc-en-24500",
idx=8,
lang="en",
short_name="fast_conformer_ctc_24500",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-nemo-fast-conformer-ctc-en-de-es-fr-14288",
idx=9,
lang="en_des_es_fr",
short_name="fast_conformer_ctc_14288",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-nemo-fast-conformer-ctc-es-1424",
idx=10,
lang="es",
short_name="fast_conformer_ctc_1424",
cmd="""
pushd $model_name
rm -rfv test_wavs
ls -lh
popd
""",
),
Expand Down
39 changes: 39 additions & 0 deletions sherpa-onnx/kotlin-api/OfflineRecognizer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,45 @@ fun getOfflineModelConfig(type: Int): OfflineModelConfig? {
)
}

7 -> {
val modelDir = "sherpa-onnx-nemo-fast-conformer-ctc-be-de-en-es-fr-hr-it-pl-ru-uk-20k"
return OfflineModelConfig(
nemo = OfflineNemoEncDecCtcModelConfig(
model = "$modelDir/model.onnx",
),
tokens = "$modelDir/tokens.txt",
)
}

8 -> {
val modelDir = "sherpa-onnx-nemo-fast-conformer-ctc-en-24500"
return OfflineModelConfig(
nemo = OfflineNemoEncDecCtcModelConfig(
model = "$modelDir/model.onnx",
),
tokens = "$modelDir/tokens.txt",
)
}

9 -> {
val modelDir = "sherpa-onnx-nemo-fast-conformer-ctc-en-de-es-fr-14288"
return OfflineModelConfig(
nemo = OfflineNemoEncDecCtcModelConfig(
model = "$modelDir/model.onnx",
),
tokens = "$modelDir/tokens.txt",
)
}

10 -> {
val modelDir = "sherpa-onnx-nemo-fast-conformer-ctc-es-1424"
return OfflineModelConfig(
nemo = OfflineNemoEncDecCtcModelConfig(
model = "$modelDir/model.onnx",
),
tokens = "$modelDir/tokens.txt",
)
}
}
return null
}

0 comments on commit 99ed16c

Please sign in to comment.