Text Generation
Transformers
Safetensors
gemma3_text
robotics
function-calling
gemma
lora
fine-tuned
edge-ai
jetson
multilingual
conversational
text-generation-inference
Instructions to use OpenmindAGI/functiongemma-finetuned-g1-multilingual with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenmindAGI/functiongemma-finetuned-g1-multilingual with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenmindAGI/functiongemma-finetuned-g1-multilingual") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenmindAGI/functiongemma-finetuned-g1-multilingual") model = AutoModelForCausalLM.from_pretrained("OpenmindAGI/functiongemma-finetuned-g1-multilingual", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenmindAGI/functiongemma-finetuned-g1-multilingual with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenmindAGI/functiongemma-finetuned-g1-multilingual" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenmindAGI/functiongemma-finetuned-g1-multilingual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenmindAGI/functiongemma-finetuned-g1-multilingual
- SGLang
How to use OpenmindAGI/functiongemma-finetuned-g1-multilingual with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "OpenmindAGI/functiongemma-finetuned-g1-multilingual" \ --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": "OpenmindAGI/functiongemma-finetuned-g1-multilingual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "OpenmindAGI/functiongemma-finetuned-g1-multilingual" \ --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": "OpenmindAGI/functiongemma-finetuned-g1-multilingual", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OpenmindAGI/functiongemma-finetuned-g1-multilingual with Docker Model Runner:
docker model run hf.co/OpenmindAGI/functiongemma-finetuned-g1-multilingual
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- zh
|
| 5 |
+
- ja
|
| 6 |
+
- fr
|
| 7 |
+
- de
|
| 8 |
+
- es
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
base_model: google/functiongemma-270m-it
|
| 11 |
+
tags:
|
| 12 |
+
- robotics
|
| 13 |
+
- function-calling
|
| 14 |
+
- gemma
|
| 15 |
+
- lora
|
| 16 |
+
- fine-tuned
|
| 17 |
+
- edge-ai
|
| 18 |
+
- jetson
|
| 19 |
+
- multilingual
|
| 20 |
+
pipeline_tag: text-generation
|
| 21 |
+
library_name: transformers
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
# FunctionGemma Robot Actions (Multilingual)
|
| 25 |
+
|
| 26 |
+
A fine-tuned [FunctionGemma 270M](https://huggingface.co/google/functiongemma-270m-it) model that converts natural language into structured robot action and emotion function calls. Supports **6 languages** with **98% accuracy** at **~59ms** on NVIDIA Jetson AGX Thor.
|
| 27 |
+
|
| 28 |
+
## Supported Languages
|
| 29 |
+
|
| 30 |
+
🇬🇧 English · 🇨🇳 中文 · 🇯🇵 日本語 · 🇫🇷 Français · 🇩🇪 Deutsch · 🇪🇸 Español
|
| 31 |
+
|
| 32 |
+
## Example
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
Input: "Can you shake hands with me?" → robot_action(shake_hand) + show_emotion(happy)
|
| 36 |
+
Input: "跟我握手" → robot_action(shake_hand) + show_emotion(happy)
|
| 37 |
+
Input: "握手してください" → robot_action(shake_hand) + show_emotion(happy)
|
| 38 |
+
Input: "Serrez-moi la main" → robot_action(shake_hand) + show_emotion(happy)
|
| 39 |
+
Input: "Gib mir die Hand" → robot_action(shake_hand) + show_emotion(happy)
|
| 40 |
+
Input: "Dame la mano" → robot_action(shake_hand) + show_emotion(happy)
|
| 41 |
+
|
| 42 |
+
Input: "我今天心情不好" → robot_action(stand_still) + show_emotion(sad)
|
| 43 |
+
Input: "あれは何ですか?" → robot_action(stand_still) + show_emotion(confused)
|
| 44 |
+
Input: "Raconte-moi une blague" → robot_action(stand_still) + show_emotion(think)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Supported Actions
|
| 48 |
+
|
| 49 |
+
| Action | Description |
|
| 50 |
+
|--------|-------------|
|
| 51 |
+
| `shake_hand` | Handshake gesture |
|
| 52 |
+
| `face_wave` | Wave hello / goodbye |
|
| 53 |
+
| `hands_up` | Raise both hands |
|
| 54 |
+
| `stand_still` | Stay idle (default for general conversation) |
|
| 55 |
+
| `show_hand` | Show open hand / present card for payment |
|
| 56 |
+
| `do_payment` | Do the payment / do the payment |
|
| 57 |
+
| `down_payment` | Finished the payment |
|
| 58 |
+
|
| 59 |
+
## Supported Emotions
|
| 60 |
+
|
| 61 |
+
| Emotion | Animation |
|
| 62 |
+
|---------|-----------|
|
| 63 |
+
| `happy` | Happy.riv |
|
| 64 |
+
| `sad` | Sad.riv |
|
| 65 |
+
| `excited` | Excited.riv |
|
| 66 |
+
| `confused` | Confused.riv |
|
| 67 |
+
| `curious` | Curious.riv |
|
| 68 |
+
| `think` | Think.riv |
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
Constrained decoding uses 2 forward passes instead of 33 autoregressive steps, achieving ~18x speedup over standard `model.generate()`.
|
| 72 |
+
|
| 73 |
+
## Training Details
|
| 74 |
+
|
| 75 |
+
| Parameter | Value |
|
| 76 |
+
|-----------|-------|
|
| 77 |
+
| Base model | `google/functiongemma-270m-it` |
|
| 78 |
+
| Method | LoRA (rank 8, alpha 16) |
|
| 79 |
+
| Training data | ~6,000 examples (545 English + ~5,450 multilingual) |
|
| 80 |
+
| Languages | English, Chinese, Japanese, French, German, Spanish |
|
| 81 |
+
| Epochs | 3 |
|
| 82 |
+
| Learning rate | 2e-4 |
|
| 83 |
+
| Batch size | 4 (effective 16 with gradient accumulation) |
|
| 84 |
+
| Max sequence length | 512 |
|
| 85 |
+
| Precision | bf16 |
|
| 86 |
+
| Hardware | NVIDIA RTX 5070 Ti (16 GB) |
|
| 87 |
+
|
| 88 |
+
Multilingual training data was generated using Claude API — 2 natural phrasings per language per English prompt, resulting in diverse and natural expressions rather than literal translations.
|
| 89 |
+
|
| 90 |
+
## Usage
|
| 91 |
+
|
| 92 |
+
### Quick Start
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 96 |
+
import torch
|
| 97 |
+
|
| 98 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 99 |
+
"OpenmindAGI/functiongemma-finetuned-g1-multilingual",
|
| 100 |
+
torch_dtype=torch.bfloat16,
|
| 101 |
+
device_map="auto",
|
| 102 |
+
)
|
| 103 |
+
tokenizer = AutoTokenizer.from_pretrained("OpenmindAGI/functiongemma-finetuned-g1-multilingual")
|
| 104 |
+
model.eval()
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
## Citation
|
| 108 |
+
|
| 109 |
+
```bibtex
|
| 110 |
+
@misc{openmindagi-functiongemma-multilingual,
|
| 111 |
+
title={FunctionGemma Robot Actions (Multilingual)},
|
| 112 |
+
author={OpenmindAGI},
|
| 113 |
+
year={2025},
|
| 114 |
+
url={https://huggingface.co/OpenmindAGI/functiongemma-finetuned-g1-multilingual}
|
| 115 |
+
}
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
## License
|
| 119 |
+
|
| 120 |
+
Fine-tuned from [google/functiongemma-270m-it](https://huggingface.co/google/functiongemma-270m-it) under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|