aoiandroid's picture
Upload README.md with huggingface_hub
2cd9582 verified
|
Raw
History Blame Contribute Delete
2.52 kB
---
license: apache-2.0
library_name: litert
tags:
- multimodal
- translation
- voice-translation
- litert
- tflite
- streamgemma
- mobile-optimized
---
# StreamGemma-Micro LiteRT-LM (mobile-pair)
![StreamGemma Banner](streamgemma_banner.jpg)
This is the **mobile-optimized 550M parameter** student variant of **StreamGemma**, compressed via dynamic range INT8 quantization and packaged for the [LiteRT-LM](https://developers.google.com/edge/litert-lm) execution framework.
It is designed specifically for resource-constrained edge devices (e.g., iPhone 12+, Pixel 6+), requiring a minimal runtime memory footprint of approximately **450 MB**.
## Model Specifications
- **Architecture**: StreamGemma-Micro (`mobile-pair` variant)
- **Parameters**: ~550M (d_model=512, 10 transformer layers)
- **Precision**: Dynamic range INT8 quantization
- **Vocab Size**: 256,000
- **Supported Languages**: Tier S priority languages (`eng`, `jpn`, `cmn`)
- **Key Pipeline Features**:
- Auto-regressive Text Prefill & Generation
- Language Identification (LID)
- Speculative Decoding support
> [!NOTE]
> **Text-Only Translation Model**: This Micro variant is designed specifically for text-to-text translation (machine translation) on-device. It does not contain an `audio_model` or a TTS (text-to-speech) head to keep its size and memory footprint optimal. For end-to-end speech-to-speech, please refer to the unreduced 2.2B models.
## Bundle Files
The repository contains:
1. **`streamgemma-micro.litertlm`**: The official unified LiteRT-LM model container file packed using `litert-lm-builder`.
2. **`README.md`**: Model card.
3. **`streamgemma_banner.jpg`**: Banner asset.
## Deployment with `streamgemma-litert-lm`
This model can be run directly using the cross-platform [msandroid/streamgemma-litert-lm](https://github.com/msandroid/streamgemma-litert-lm) SDKs (Python, Android Kotlin, iOS Swift, Web TypeScript, Flutter, C++, Rust).
### Python Example
```python
import numpy as np
from streamgemma_litert import StreamGemmaEngine, EngineConfig, SessionConfig
# Initialize the engine with the .litertlm file
config = EngineConfig(model_path="path/to/streamgemma-micro.litertlm")
engine = StreamGemmaEngine(config)
# Start a translation session
session = engine.create_session(SessionConfig())
# Feed input tokens (shape [1, 128])
input_tokens = np.array([[2, 101, 102, 103] + [0]*124], dtype=np.int32)
result = session.feed_text(input_tokens)
print(f"[{result.source_language}] {result.text}")
```