Repository navigation
recipes: sherpa-onnx 2.0.1 + flet-libonnxruntime 1.28.2 - #139
Merged
Merged
Conversation
sherpa-onnx (speech-to-text, text-to-speech, VAD, keyword spotting) for Android and iOS, linking a prebuilt ONNX Runtime from the new flet-libonnxruntime recipe. One self-contained wheel per Python, with a README and a transcribe example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds sherpa-onnx 2.0.1 for Android and iOS: offline speech-to-text, text-to-speech, voice activity detection and keyword spotting on ONNX Runtime. Requested in flet-dev/flet#7096.
It links a prebuilt ONNX Runtime from a new
flet-libonnxruntimerecipe, so the build does not compile ONNX Runtime itself.Changes
flet-libonnxruntime1.28.2 (new,build.sh): repackages csukuangfj/onnxruntime-libs, the prebuilt artifacts sherpa-onnx's own mobile builds use, at the version sherpa-onnx 2.0.1 builds against. Android stages the sharedlibonnxruntime.so; iOS stages the static archive, thinned per slice. The zips have no wrapping folder, sosource.strip: 0. They carry no notices either, solicenses/holds onnxruntime'sLICENSEandThirdPartyNotices.txt(License-Expression: MIT).sherpa-onnx2.0.1: setup.py drives CMake, pointed at the staged ONNX Runtime throughSHERPA_ONNXRUNTIME_{INCLUDE,LIB}_DIR(host_build, so no runtime requirement).SHERPA_ONNX_SPLIT_PYTHON_PACKAGEstays unset, giving one self-contained wheel with no dependency on PyPI'ssherpa-onnx-core, which has no iOS wheels. Three patches:android-no-jni.patch: stop CMake force-enabling the 4 MB JNI library, which a Flet app cannot use.android-preload-ort.patch: load the bundledlibonnxruntime.sobefore the extension (no RUNPATH on Android), by path or by soname.onnxruntime-license.patch: ship ONNX Runtime's MIT licence in the wheel.recipes/sherpa-onnx/README.mdand atranscribeexample.Validation
prebuild_recipes=flet-libonnxruntime(run): on-device tests 5/5, none skipped, on Android 3.12/3.13/3.14 and iOS 3.13/3.14. The iOS 3.12 job never got a macOS runner; I built those three slices locally instead.transcribeexample, built from these wheels, downloads a 29 MB English model and transcribes its sample correctly on an Android arm64 emulator and an iPhone simulator.CI note:
sherpa-onnxneedsflet-libonnxruntimeat build time, and it is not published yet, so this PR's own CI may fail the sherpa-onnx legs on the Pythons where thebuild.shrecipe is skipped. A dispatch withprebuild_recipes=flet-libonnxruntimecovers it, as in the fork run above.Consumer notes
Flet apps can run speech recognition and synthesis on the device, offline once a model is downloaded, with
sherpa-onnx==2.0.1(no numpy needed). See the recipe README for models, storage and app size, and thetranscribeexample.