cpxavier2's picture
Add README Model Card
0321716 verified
|
Raw
History Blame Contribute Delete
1.17 kB
---
license: gemma
base_model: google/codegemma-7b-it
library_name: litert
tags:
- litert
- litertlm
- codegemma
- int4
- android
- on-device
pipeline_tag: text-generation
---
# CodeGemma 7B IT (INT4 LiteRT LM Model for Android)
This repository contains Google's **CodeGemma 7B Instruction-Tuned (`google/codegemma-7b-it`)** quantized to **INT4** and packaged into the **`.litertlm`** format for on-device execution on Android using Google's LiteRT runtime.
## Model Details
- **Base Model**: [google/codegemma-7b-it](https://huggingface.co/google/codegemma-7b-it)
- **Format**: `.litertlm` (LiteRT LM Model Bundle)
- **Quantization**: INT4 (`dynamic_wi4_afp32`)
- **Target Runtime**: Android LiteRT C++/Kotlin SDK
## Usage on Android
Download the `.litertlm` bundle into your Android app's assets or internal storage and load it via LiteRT-LM:
```kotlin
val modelPath = File(context.filesDir, "codegemma-7b-it-int4.litertlm").absolutePath
val options = ModelOptions.builder()
.setModelPath(modelPath)
.build()
val engine = LiteRtLmEngine.create(options)
val response = engine.generate("Write a Kotlin function to check prime numbers.")
println(response)
```