Instructions to use barakplasma/translategemma-4b-it-android-task-quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use barakplasma/translategemma-4b-it-android-task-quantized 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
Codex commited on
Commit ·
549e008
1
Parent(s): 5f62353
Document conversion hardware requirements
Browse files- README.md +12 -2
- scripts/multi_quant_build_upload.py +5 -2
README.md
CHANGED
|
@@ -107,7 +107,17 @@ The `scripts/` folder contains the full conversion pipeline:
|
|
| 107 |
|
| 108 |
### Reproduce a build
|
| 109 |
|
| 110 |
-
Requirements:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
```bash
|
| 113 |
# Clone LiteRT-LM builder (needed by bundle_litertlm.py)
|
|
@@ -118,7 +128,7 @@ pip install litert-torch==0.8.0 mediapipe transformers huggingface-hub
|
|
| 118 |
# Download model
|
| 119 |
huggingface-cli download google/translategemma-4b-it --local-dir ./translategemma-4b-it
|
| 120 |
|
| 121 |
-
# Convert to TFLite with KV cache (~30-60 min, needs
|
| 122 |
python scripts/convert_translategemma_android.py \
|
| 123 |
--model-dir ./translategemma-4b-it \
|
| 124 |
--tflite-dir ./tflite_output/dynamic_int8 \
|
|
|
|
| 107 |
|
| 108 |
### Reproduce a build
|
| 109 |
|
| 110 |
+
Requirements: 96 GB minimum system RAM, 128 GB preferred, Python 3.12, `litert-torch==0.8.0`.
|
| 111 |
+
|
| 112 |
+
Observed multimodal export peak RSS was about 73.9 GiB, so 96 GB is the practical floor once Python, model cache, filesystem cache, and conversion overhead are included. Use 128 GB when running multiple quantization attempts or keeping extra build artifacts.
|
| 113 |
+
|
| 114 |
+
Ideal Vast.ai image:
|
| 115 |
+
|
| 116 |
+
- Vast.ai PyTorch image or an Ubuntu-based NVIDIA/PyTorch CUDA image, not a bare CUDA runtime image.
|
| 117 |
+
- Python 3.12 with `uv`/pip, Git, Git LFS, Hugging Face CLI, and build tools available.
|
| 118 |
+
- CUDA/PyTorch wheel support matching the rented GPU architecture; use CUDA 12.8+ PyTorch wheels on Blackwell GPUs.
|
| 119 |
+
- 96+ GB RAM and at least 80 GB free disk; 150+ GB disk is safer for source checkpoint, caches, exported TFLite files, and `.litertlm` bundles.
|
| 120 |
+
- Persistent `/workspace` volume if the instance may be stopped/recycled before upload.
|
| 121 |
|
| 122 |
```bash
|
| 123 |
# Clone LiteRT-LM builder (needed by bundle_litertlm.py)
|
|
|
|
| 128 |
# Download model
|
| 129 |
huggingface-cli download google/translategemma-4b-it --local-dir ./translategemma-4b-it
|
| 130 |
|
| 131 |
+
# Convert to TFLite with KV cache (~30-60 min, needs 96 GB minimum RAM)
|
| 132 |
python scripts/convert_translategemma_android.py \
|
| 133 |
--model-dir ./translategemma-4b-it \
|
| 134 |
--tflite-dir ./tflite_output/dynamic_int8 \
|
scripts/multi_quant_build_upload.py
CHANGED
|
@@ -196,7 +196,10 @@ def plan_quants(requested_quants, native_ok: bool):
|
|
| 196 |
|
| 197 |
def main():
|
| 198 |
ap = argparse.ArgumentParser(
|
| 199 |
-
description=
|
|
|
|
|
|
|
|
|
|
| 200 |
)
|
| 201 |
ap.add_argument("--converter-script", default="/home/ubuntu/convert_translategemma_android.py")
|
| 202 |
ap.add_argument("--model-id", default="google/translategemma-4b-it")
|
|
@@ -477,4 +480,4 @@ def main():
|
|
| 477 |
|
| 478 |
|
| 479 |
if __name__ == "__main__":
|
| 480 |
-
main()
|
|
|
|
| 196 |
|
| 197 |
def main():
|
| 198 |
ap = argparse.ArgumentParser(
|
| 199 |
+
description=(
|
| 200 |
+
"Run multi-quant conversion+bundle and upload successful artifacts to HF. "
|
| 201 |
+
"Requires 96 GB minimum system RAM; 128 GB is preferred for headroom."
|
| 202 |
+
)
|
| 203 |
)
|
| 204 |
ap.add_argument("--converter-script", default="/home/ubuntu/convert_translategemma_android.py")
|
| 205 |
ap.add_argument("--model-id", default="google/translategemma-4b-it")
|
|
|
|
| 480 |
|
| 481 |
|
| 482 |
if __name__ == "__main__":
|
| 483 |
+
main()
|