google/mobile-actions
Viewer • Updated • 9.65k • 1.69k • 269
How to use essobi/functiongemma-mobile-actions-v6-16bit with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="essobi/functiongemma-mobile-actions-v6-16bit")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("essobi/functiongemma-mobile-actions-v6-16bit")
model = AutoModelForCausalLM.from_pretrained("essobi/functiongemma-mobile-actions-v6-16bit")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use essobi/functiongemma-mobile-actions-v6-16bit with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "essobi/functiongemma-mobile-actions-v6-16bit"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "essobi/functiongemma-mobile-actions-v6-16bit",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/essobi/functiongemma-mobile-actions-v6-16bit
How to use essobi/functiongemma-mobile-actions-v6-16bit with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "essobi/functiongemma-mobile-actions-v6-16bit" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "essobi/functiongemma-mobile-actions-v6-16bit",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "essobi/functiongemma-mobile-actions-v6-16bit" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "essobi/functiongemma-mobile-actions-v6-16bit",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use essobi/functiongemma-mobile-actions-v6-16bit 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 essobi/functiongemma-mobile-actions-v6-16bit 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 essobi/functiongemma-mobile-actions-v6-16bit to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for essobi/functiongemma-mobile-actions-v6-16bit to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="essobi/functiongemma-mobile-actions-v6-16bit",
max_seq_length=2048,
)How to use essobi/functiongemma-mobile-actions-v6-16bit with Docker Model Runner:
docker model run hf.co/essobi/functiongemma-mobile-actions-v6-16bit
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("essobi/functiongemma-mobile-actions-v6-16bit")
model = AutoModelForCausalLM.from_pretrained("essobi/functiongemma-mobile-actions-v6-16bit")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))A fine-tuned version of FunctionGemma 270M optimized for mobile device function calling. This model excels at understanding natural language commands and mapping them to structured function calls for common mobile actions.
| Function | Description | Example Input |
|---|---|---|
set_alarm |
Set alarms | "Wake me up at 7am" |
create_reminder |
Create reminders | "Remind me to buy milk" |
set_timer |
Set countdown timers | "Timer for 10 minutes" |
make_call |
Make phone calls | "Call Mom" |
send_message |
Send text messages | "Text John I'm running late" |
create_calendar_event |
Schedule events | "Schedule meeting at 3pm" |
play_music |
Play music | "Play some jazz" |
get_weather |
Get weather info | "What's the weather like?" |
open_app |
Open applications | "Open the camera" |
navigate |
Get directions | "Navigate to the airport" |
set_volume |
Adjust volume | "Turn the volume up" |
calculator |
Math calculations | "What's 15 times 23?" |
from vllm import LLM, SamplingParams
llm = LLM(model="essobi/functiongemma-mobile-actions-v6-16bit", trust_remote_code=True)
# See full documentation for prompt format and tool definitions
<start_function_call>call:function_name{param1:<escape>value1<escape>,param2:<escape>value2<escape>}<end_function_call>
This model is released under the Gemma License.
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="essobi/functiongemma-mobile-actions-v6-16bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)