Skip to content

Commit

Permalink
Add APK for small paraformer (#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Jul 15, 2024
1 parent b2c283f commit fa07bbc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/apk/generate-vad-asr-apk-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@ def get_models():
popd
""",
),
Model(
model_name="sherpa-onnx-paraformer-zh-small-2024-03-09",
idx=14,
lang="zh",
short_name="small_paraformer",
rule_fsts="itn_zh_number.fst",
cmd="""
if [ ! -f itn_zh_number.fst ]; then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn_zh_number.fst
fi
pushd $model_name
rm -fv README.md
rm -fv *.py
rm -fv *.yaml
rm -fv *.mvn
rm -rfv test_wavs
ls -lh
popd
""",
),
Model(
model_name="icefall-asr-zipformer-wenetspeech-20230615",
idx=4,
Expand Down
11 changes: 11 additions & 0 deletions sherpa-onnx/kotlin-api/OfflineRecognizer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,17 @@ fun getOfflineModelConfig(type: Int): OfflineModelConfig? {
modelType = "transducer",
)
}

14 -> {
val modelDir = "sherpa-onnx-paraformer-zh-small-2024-03-09"
return OfflineModelConfig(
paraformer = OfflineParaformerModelConfig(
model = "$modelDir/model.int8.onnx",
),
tokens = "$modelDir/tokens.txt",
modelType = "paraformer",
)
}
}
return null
}

0 comments on commit fa07bbc

Please sign in to comment.