Automatic Speech Recognition
LiteRT-LM
LiteRT
LiteRT
asr
speech-to-text
on-device
android
qwen3-asr
int8
Instructions to use litert-community/Rumble-2-Flash-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use litert-community/Rumble-2-Flash-LiteRT with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli # A single .litertlm file in the repo is picked automatically; otherwise the CLI asks which one to run # (or pass its name right after the repo id). litert-lm run \ --from-huggingface-repo=litert-community/Rumble-2-Flash-LiteRT \ --prompt="Write me a poem"
- LiteRT
How to use litert-community/Rumble-2-Flash-LiteRT with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download omni_runner_skip_until.patch from litert-community/Rumble-2-Flash-LiteRT: direct link, hf CLI and curl.
- Browser
- Download file 3.55 kB
-
https://huggingface.co/litert-community/Rumble-2-Flash-LiteRT/resolve/main/omni_runner_skip_until.patch
- Command line
-
hf download hf://litert-community/Rumble-2-Flash-LiteRT/omni_runner_skip_until.patch
-
curl -L -o omni_runner_skip_until.patch https://huggingface.co/litert-community/Rumble-2-Flash-LiteRT/resolve/main/omni_runner_skip_until.patch
3.55 kB
| diff --git a/omni/BUILD b/omni/BUILD | |
| index ea163f1..5db777e 100644 | |
| --- a/omni/BUILD | |
| +++ b/omni/BUILD | |
| cc_binary( | |
| "//omni/text2speech:qwen3_tts", # build_cleaner: keep | |
| "//runtime/executor:default_gpu_accelerator", | |
| "//runtime/proto:any2any_session_config_cc_proto", | |
| + "//runtime/proto:speech2text_metadata_cc_proto", | |
| "//runtime/proto:speech2text_session_config_cc_proto", | |
| "//runtime/proto:text2image_session_config_cc_proto", | |
| "//runtime/proto:text2speech_session_config_cc_proto", | |
| diff --git a/omni/omni_runner.cc b/omni/omni_runner.cc | |
| index ba0e53f..1be1840 100644 | |
| --- a/omni/omni_runner.cc | |
| +++ b/omni/omni_runner.cc | |
| #include <fstream> | |
| #include <iostream> | |
| #include <memory> | |
| +#include <optional> | |
| #include <string> | |
| #include <system_error> // NOLINT: Required for std::error_code. | |
| #include <utility> | |
| #include "omni/omni_registry.h" | |
| #include "omni/omni_session.h" | |
| #include "runtime/proto/any2any_session_config.pb.h" | |
| +#include "runtime/proto/speech2text_metadata.pb.h" | |
| #include "runtime/proto/speech2text_session_config.pb.h" | |
| #include "runtime/proto/text2image_session_config.pb.h" | |
| #include "runtime/proto/text2speech_session_config.pb.h" | |
| ABSL_FLAG(float, overlap_ratio, 0.4f, | |
| "ASR chunk overlap ratio between 0.0 and 1.0."); | |
| ABSL_FLAG(std::string, text_merger_type, "timestamp", | |
| "ASR text merger strategy: timestamp or levenshtein."); | |
| +ABSL_FLAG(std::optional<int>, asr_decode_skip_until_token_id, std::nullopt, | |
| + "Overrides Speech2TextMetadata.decode_skip_until_token_id, the token " | |
| + "that ends the model's header before the transcript (e.g. " | |
| + "<asr_text> for fine-tuned Qwen3-ASR checkpoints with a remapped " | |
| + "vocabulary). -1 disables header skipping."); | |
| // TTS session flags. | |
| ABSL_FLAG(std::string, language, "en-US", | |
| absl::Status RunOmniRunner() { | |
| litert::lm::proto::Any2AnySessionConfig any2any_config; | |
| litert::lm::proto::Speech2TextSessionConfig asr_config; | |
| + litert::lm::proto::Speech2TextMetadata asr_metadata; | |
| litert::lm::proto::Text2SpeechSessionConfig tts_config; | |
| litert::lm::proto::Text2ImageSessionConfig t2i_config; | |
| const MessageLite* session_config = nullptr; | |
| + const MessageLite* metadata = nullptr; | |
| if (reg.metadata_proto_type_id == "litert.lm.proto.Any2AnyMetadata") { | |
| any2any_config.set_generate_audio(absl::GetFlag(FLAGS_generate_audio)); | |
| absl::Status RunOmniRunner() { | |
| TEXT_MERGER_TYPE_TIMESTAMP); | |
| } | |
| session_config = &asr_config; | |
| + if (const auto skip_until_id = | |
| + absl::GetFlag(FLAGS_asr_decode_skip_until_token_id); | |
| + skip_until_id.has_value()) { | |
| + asr_metadata.set_decode_skip_until_token_id(*skip_until_id); | |
| + metadata = &asr_metadata; | |
| + } | |
| } else if (reg.metadata_proto_type_id == | |
| "litert.lm.proto.Text2ImageMetadata") { | |
| if (text.empty()) { | |
| absl::Status RunOmniRunner() { | |
| const absl::Time load_start = absl::Now(); | |
| ABSL_ASSIGN_OR_RETURN( | |
| - auto engine, OmniEngine::Create(model_name, settings, session_config)); | |
| + auto engine, | |
| + OmniEngine::Create(model_name, settings, session_config, metadata)); | |
| const double load_sec = absl::ToDoubleSeconds(absl::Now() - load_start); | |
| ABSL_LOG(INFO) << absl::StrFormat("Loaded OmniEngine '%s' in %.3f s.", | |
| engine->model_name(), load_sec); | |