Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FunctionGemma Robot Actions
|
| 2 |
+
|
| 3 |
+
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. Designed for real-time inference on edge devices like the NVIDIA Jetson AGX Thor.
|
| 4 |
+
|
| 5 |
+
## Overview
|
| 6 |
+
|
| 7 |
+
This model takes a user's voice or text input and outputs two function calls:
|
| 8 |
+
|
| 9 |
+
- **`robot_action`** — a physical action for the robot to perform
|
| 10 |
+
- **`show_emotion`** — an emotion to display on the robot's avatar screen (Rive animations)
|
| 11 |
+
|
| 12 |
+
General conversation defaults to `stand_still` with a contextually appropriate emotion.
|
| 13 |
+
|
| 14 |
+
## Example
|
| 15 |
+
|
| 16 |
+
```
|
| 17 |
+
Input: "Can you shake hands with me?"
|
| 18 |
+
Output: robot_action(action_name="shake_hand") + show_emotion(emotion="happy")
|
| 19 |
+
|
| 20 |
+
Input: "What is that?"
|
| 21 |
+
Output: robot_action(action_name="stand_still") + show_emotion(emotion="confused")
|
| 22 |
+
|
| 23 |
+
Input: "I feel sad"
|
| 24 |
+
Output: robot_action(action_name="stand_still") + show_emotion(emotion="sad")
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
## Supported Actions
|
| 28 |
+
|
| 29 |
+
| Action | Description |
|
| 30 |
+
|--------|-------------|
|
| 31 |
+
| `shake_hand` | Handshake gesture |
|
| 32 |
+
| `face_wave` | Wave hello |
|
| 33 |
+
| `hands_up` | Raise both hands |
|
| 34 |
+
| `stand_still` | Stay idle (default for general conversation) |
|
| 35 |
+
| `show_hand` | Show open hand |
|
| 36 |
+
|
| 37 |
+
## Supported Emotions
|
| 38 |
+
|
| 39 |
+
| Emotion | Animation |
|
| 40 |
+
|---------|-----------|
|
| 41 |
+
| `happy` | Happy.riv |
|
| 42 |
+
| `sad` | Sad.riv |
|
| 43 |
+
| `excited` | Excited.riv |
|
| 44 |
+
| `confused` | Confused.riv |
|
| 45 |
+
| `curious` | Curious.riv |
|
| 46 |
+
| `think` | Think.riv |
|
| 47 |
+
|
| 48 |
+
## Performance on NVIDIA Jetson AGX Thor
|
| 49 |
+
|
| 50 |
+
Benchmarked with constrained decoding (2 forward passes instead of 33 autoregressive steps):
|
| 51 |
+
|
| 52 |
+
| Metric | Value |
|
| 53 |
+
|--------|-------|
|
| 54 |
+
| Min latency | 52 ms |
|
| 55 |
+
| Max latency | 72 ms |
|
| 56 |
+
| **Avg latency** | **59 ms** |
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
## Training Details
|
| 60 |
+
|
| 61 |
+
| Parameter | Value |
|
| 62 |
+
|-----------|-------|
|
| 63 |
+
| Base model | `google/functiongemma-270m-it` |
|
| 64 |
+
| Method | LoRA (rank 8, alpha 16) |
|
| 65 |
+
| Training data | 545 examples (490 train / 55 eval) |
|
| 66 |
+
| Epochs | 5 |
|
| 67 |
+
| Learning rate | 2e-4 |
|
| 68 |
+
| Batch size | 2 (effective 4 with gradient accumulation) |
|
| 69 |
+
| Max sequence length | 512 |
|
| 70 |
+
| Precision | bf16 |
|
| 71 |
+
|
| 72 |
+
### Quick Start
|
| 73 |
+
|
| 74 |
+
```python
|
| 75 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 76 |
+
import torch
|
| 77 |
+
|
| 78 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 79 |
+
"OpenmindAGI/functiongemma-robot-actions",
|
| 80 |
+
torch_dtype=torch.bfloat16,
|
| 81 |
+
device_map="auto",
|
| 82 |
+
)
|
| 83 |
+
tokenizer = AutoTokenizer.from_pretrained("OpenmindAGI/functiongemma-robot-actions")
|
| 84 |
+
model.eval()
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
## Citation
|
| 88 |
+
|
| 89 |
+
```bibtex
|
| 90 |
+
@misc{openmindagi-functiongemma-robot-actions,
|
| 91 |
+
title={FunctionGemma Robot Actions},
|
| 92 |
+
author={OpenmindAGI},
|
| 93 |
+
year={2025},
|
| 94 |
+
url={https://huggingface.co/OpenmindAGI/functiongemma-robot-actions}
|
| 95 |
+
}
|
| 96 |
+
```
|
| 97 |
+
|