Downloads · 30 days
10
21% of all-time downloads
abubakar-siddik/functiongemma-270m-it-mobile-actions
functiongemma-270m-it-mobile-actions is a machine learning model from abubakar-siddik. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This is a fine-tuned version of google/functiongemma-270m-it specialized for mobile device function calling tasks. The model has been trained on the Google Mobile Actions dataset to reliably execute phone commands thr…
Downloads · 30 days
10
21% of all-time downloads
All-time downloads
47
Public
Parameters
268M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 97%
From the Hugging Face model README
This is a fine-tuned version of google/functiongemma-270m-it specialized for mobile device function calling tasks. The model has been trained on the Google Mobile Actions dataset to reliably execute phone commands through function calling.
The model can call the following 7 mobile device functions:
pip install transformers torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "abubakar-siddik/functiongemma-270m-it-mobile-actions"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype="auto"
)
# Define available tools
tools = [
{
"function": {
"name": "create_calendar_event",
"description": "Creates a new calendar event.",
"parameters": {
"type": "OBJECT",
"properties": {
"title": {"type": "STRING", "description": "The title of the event."},
"datetime": {"type": "STRING", "description": "The date and time in YYYY-MM-DDTHH:MM:SS format."}
},
"required": ["title", "datetime"]
}
}
}
# Add other tools as needed...
]
# Create messages
messages = [
{
"role": "developer",
"content": "Current date and time: 2024-11-15T05:59:00. You are a model that can do function calling."
},
{
"role": "user",
"content": "Schedule a team meeting tomorrow at 4pm"
}
]
# Generate response
prompt = tokenizer.apply_chat_template(
messages,
tools=tools,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)
Input: "Schedule a team meeting tomorrow at 4pm"
Output (function call):
<start_function_call>call:create_calendar_event{title:<escape>team meeting<escape>,datetime:<escape>2024-11-16T16:00:00<escape>}<end_function_call>
The fine-tuned model shows significant improvement over the base FunctionGemma 270M model for mobile action tasks:
This model can be converted to .litertlm format for deployment on Android devices using Google AI Edge tools.
This model should be used responsibly:
Model Card Version: 1.0.0 Last Updated: 2025-12-29