abhishekgoogle's picture
Updated steps to Fine-Tune & Compile a Function Gemma model (#3)
f1c7b94
|
Raw
History Blame Contribute Delete
5.45 kB
metadata
license: gemma
base_model: google/functiongemma-270m-it
pipeline_tag: text-generation
library_name: litert-lm
tags:
  - gemma3
  - gemma
  - functiongemma
extra_gated_heading: Access Function Gemma 270M FT Mobile Actions on Hugging Face
extra_gated_prompt: >-
  To access Gemma 270M FT Mobile Actions on Hugging Face, you are required to
  review and agree to the gemma license. To do this, please ensure you are
  logged in to Hugging Face and click below. Requests are processed immediately.
extra_gated_button_content: Acknowledge licensed

litert-community/functiongemma-270m-ft-mobile-actions

Main Model Card: google/functiongemma-270m-it

This model card provides the Mobile Actions model that is ready for deployment on the Google AI Edge Gallery app.

Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. This particular Gemma model is especially small so it is ideal for on-device use cases. By running this model on device, users can have private access to Generative AI technology without even requiring an internet connection.

Try it live

The Mobile Actions model is a finetune of google/functiongemma-270m-it. To try out Mobile Actions, download the Google AI Edge Gallery app on your phone, open the Mobile Actions panel and tap the download button.

Performance

Android

Benchmarked on S25 Ultra with 512 prefill tokens and 256 decode tokens.

Backend Quantization scheme Context length Prefill (tokens/sec) Decode (tokens/sec) Time-to-first-token Model size (MB) Peak RSS Memory (MB)

CPU

dynamic_int8

1024

2238 tk/s

154.2 tk/s

0.24 s

289 MB

510 MB

Notes:

  • Model Size: measured by the size of the file on disk.
  • The inference on CPU is accelerated via the LiteRT XNNPACK delegate with 4 threads
  • Benchmark is run with cache enabled and initialized. During the first run, the latency and memory usage may differ.

Fine-tune & Compile for Google Tensor

Follow these steps to customize and deploy the model on Google Tensor hardware:

Step 1: Fine-Tune the Model

Run the fine-tuning pipeline by following the step-by-step notebook:

Step 2: Compile for Google Tensor

⚠️ Important Compilation Note: When running the export-hf command, make sure to pass the path to your local compiled tflite model (--model=<compiled tflite model>) instead of the standard Hugging Face repository name (--model=<hf-repo-name>).