Run this model with HF Jobs
Run acul3/OmniVoice-LiteRT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/acul3/OmniVoice-LiteRT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/acul3/OmniVoice-LiteRT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use acul3/OmniVoice-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use acul3/OmniVoice-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
Upload CONVERSION_GUIDE.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107# OmniVoice .tflite Conversion Guide
## Prerequisites
- **x86 Linux machine** (litert-torch requires TensorFlow which has no aarch64 wheels for ai-edge-tensorflow)- Python 3.10+- ~8GB RAM
## Steps
### 1. Install dependencies
```bashpython3 -m venv .venv && source .venv/bin/activatepip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpupip install litert-torch transformers==5.3.0 accelerate soundfile```
### 2. Download from HuggingFace
```bashpip install huggingface_hubpython3 -c "from huggingface_hub import snapshot_downloadsnapshot_download('acul3/OmniVoice-LiteRT', local_dir='./omnivoice-litert')"```
### 3. Convert backbone
```pythonimport torchimport litert_torchfrom export_backbone import OmniVoiceBackbonefrom omnivoice import OmniVoice
# Load original modelmodel = OmniVoice.from_pretrained("k2-fsa/OmniVoice", device_map="cpu", dtype=torch.float32)
# Extract backbonebackbone = OmniVoiceBackbone(model).eval()
# Sample inputs for tracingseq_len = 512input_ids = torch.randint(0, 1024, (1, 8, seq_len), dtype=torch.long)audio_mask = torch.zeros(1, seq_len, dtype=torch.bool)audio_mask[:, 200:] = True
# Convert to .tfliteedge_model = litert_torch.convert(backbone, (input_ids, audio_mask))edge_model.export("omnivoice_backbone.tflite")print("Backbone exported!")```
### 4. Convert decoder
```pythonfrom export_decoder import OmniVoiceDecoder
decoder = OmniVoiceDecoder(model.audio_tokenizer).eval()audio_codes = torch.randint(0, 1024, (1, 8, 100), dtype=torch.long)
edge_decoder = litert_torch.convert(decoder, (audio_codes,))edge_decoder.export("omnivoice_decoder.tflite")print("Decoder exported!")```
### 5. Verify
```python# Load and testimport numpy as npfrom litert import Interpreter
interp = Interpreter(model_path="omnivoice_backbone.tflite")interp.allocate_tensors()print("Backbone loaded OK, input details:", interp.get_input_details())```
## Critical Notes
- **Conversion is lossless** — identical output to PyTorch- Use **FP16** on device — mobile GPUs natively support it- **Do NOT use INT8** — quality degrades over 32 diffusion steps- **Bidirectional attention** is baked into the exported backbone (all-True mask)- Diffusion loop runs in app code (Kotlin), not in the model
## Android Integration
```kotlin// Load modelsval backbone = Interpreter(loadModelFile("omnivoice_backbone.tflite"))val decoder = Interpreter(loadModelFile("omnivoice_decoder.tflite"))
// Enable GPU delegateval gpuDelegate = GpuDelegate()val options = Interpreter.Options().addDelegate(gpuDelegate)
// Run diffusion loopfor (step in 0 until numSteps) { backbone.run(inputIds, logits) // Sample tokens, unmask top-k}
// Decode to audiodecoder.run(generatedTokens, waveform)```CONVERSION_GUIDE.mdAdded+107