google/mobile-actions
Viewer • Updated • 9.65k • 1.57k • 268
How to use dousery/functiongemma-mobile-actions with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dousery/functiongemma-mobile-actions to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dousery/functiongemma-mobile-actions to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dousery/functiongemma-mobile-actions to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="dousery/functiongemma-mobile-actions",
max_seq_length=2048,
)This model is fine-tuned version of google/functiongemma-270m-it model for mobile action function calling tasks.
Handles function-calling style mobile actions such as creating calendar events, sending emails, adding contacts, showing maps, managing Wi‑Fi, and toggling the flashlight, based on the google/mobile-actions dataset.
pip install torch transformers datasets accelerate huggingface_hub
import torch
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model_id = "dousery/functiongemma-mobile-actions"
device = "cuda" if torch.cuda.is_available() else "cpu"
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16 if device == "cuda" else torch.float32,
device_map="auto" if device == "cuda" else None,
trust_remote_code=True,
).eval()
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
if device == "cpu":
model = model.to(device)
dataset = load_dataset("google/mobile-actions", split="train")
text = tokenizer.apply_chat_template(
dataset[0]["messages"][:2],
tools=dataset[0]["tools"],
tokenize=False,
add_generation_prompt=True,
).removeprefix("<bos>")
inputs = tokenizer(text, return_tensors="pt").to(device)
with torch.no_grad():
_ = model.generate(
**inputs,
max_new_tokens=256,
streamer=TextStreamer(tokenizer, skip_prompt=True),
top_p=0.95,
top_k=64,
temperature=1.0,
)
@misc{functiongemma-mobile-actions,
title={FunctionGemma Mobile Actions - Merged for Mobile Function Calling},
author={dousery},
year={2025},
howpublished={\url{https://huggingface.co/dousery/functiongemma-mobile-actions}}
}
Apache-2.0 (inherits base model license).
Base model
google/functiongemma-270m-it