Skip to content

Commit

Permalink
Android APK for GigaAM transducer models.
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Oct 25, 2024
1 parent 90d369b commit 2f0c7d0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/export-nemo-giga-am-to-onnx.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: export-nemo-giga-am-to-onnx

on:
push:
branches:
- nemo-giga-am-rnnt
workflow_dispatch:

concurrency:
Expand Down
18 changes: 18 additions & 0 deletions scripts/apk/generate-vad-asr-apk-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@ def get_models():
ls -lh
popd
""",
),
Model(
model_name="sherpa-onnx-nemo-transducer-giga-am-russian-2024-10-24",
idx=20,
lang="ru",
short_name="nemo_transducer_giga_am",
cmd="""
pushd $model_name
rm -rfv test_wavs
rm -fv *.sh
rm -fv *.py
ls -lh
popd
""",
),
Expand Down
2 changes: 1 addition & 1 deletion scripts/nemo/GigaAM/run-ctc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function download_files() {
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/ctc/ctc_model_config.yaml
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/example.wav
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/long_example.wav
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM%20License_NC.pdf
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/GigaAM%20License_NC.pdf
}

install_nemo
Expand Down
2 changes: 1 addition & 1 deletion scripts/nemo/GigaAM/run-rnnt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function download_files() {
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/rnnt/rnnt_model_config.yaml
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/example.wav
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/long_example.wav
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM%20License_NC.pdf
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/GigaAM%20License_NC.pdf
curl -SL -O https://huggingface.co/csukuangfj/tmp-files/resolve/main/GigaAM/rnnt/tokenizer_all_sets.tar
tar -xf tokenizer_all_sets.tar && rm tokenizer_all_sets.tar
ls -lh
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 @@ -404,6 +404,19 @@ fun getOfflineModelConfig(type: Int): OfflineModelConfig? {
tokens = "$modelDir/tokens.txt",
)
}

20 -> {
val modelDir = "sherpa-onnx-nemo-transducer-giga-am-russian-2024-10-24"
return OfflineModelConfig(
transducer = OfflineTransducerModelConfig(
encoder = "$modelDir/encoder.int8.onnx",
decoder = "$modelDir/decoder.onnx",
joiner = "$modelDir/joiner.onnx",
),
tokens = "$modelDir/tokens.txt",
modelType = "nemo_transducer",
)
}
}
return null
}

0 comments on commit 2f0c7d0

Please sign in to comment.