--- license: other license_name: mixed-sources language: - multilingual - en - es - fr - de - it - pt - nl - pl - ru - tr - ar - hi - zh - ja - ko task_categories: - text-classification pretty_name: Reachy gestures data size_categories: - 100K .venv/bin/python launch/watch.py smoke= ``` The run ends with `{"model": ...}` score lines for `model.onnx` and `model_qint8.onnx`. The scores will be poor, because it trained on 1% for one epoch. ### 2. Teacher (skip it to reuse the published teacher) ```bash DATA_DIR=splits/agreed TAG=-lab-agreed STUDENT_EPOCHS=10 \ POOLS="gen_train3.jsonl gen_pool11.jsonl gen_pool12.jsonl gen_pool13.jsonl real_all.jsonl" \ .venv/bin/python launch/teachers.py full qwen3-emb-8b ``` This runs on an H200. It trains the teacher and also distills a 10-epoch side student, which was only used for comparison. The teacher lands in `$NAMESPACE/reachy-gesture-teacher-qwen3-emb-8b-lab-agreed`. ### 3. Student (the shipped model) ```bash TEACHER_BF16=1 FLAVOR=h200 TEACHER_REPO=HuggingFaceM4/reachy-gestures-teacher DATA_DIR=splits/merged \ POOLS="gen_train3.jsonl gen_pool11.jsonl gen_pool12.jsonl gen_pool13.jsonl gen_pool21.jsonl gen_pool22.jsonl gen_pool23.jsonl gen_pool24.jsonl gen_pool25.jsonl gen_pool26.jsonl real_all.jsonl" \ .venv/bin/python launch/students.py full-q8b minilm-e15-t4 ``` If you trained your own teacher in step 2, point `TEACHER_REPO` at it. `launch/students.py` lists the other variants that were tried (`minilm-e15-t2`, `mpnet-e10-t2`, `e5small-…`). You can pass several names to launch them side by side. ### 4. Read the scores ```bash .venv/bin/python launch/watch.py q8b= # live: one line per epoch .venv/bin/python launch/collect.py q8b= # final int8 ONNX scores at the val-chosen threshold ``` The shipped model scored 83.5% on `test`, 94.9% on `test_real` and 83.2% on `hard`, with 6 opposite-feeling mistakes. Training on GPUs isn't bit-exact, so expect to land within about a point of those. ### 5. Ship it 1. Copy the new run's files (`model_qint8.onnx`, `gesture_heads.npz`, `gesture_labels.json`, tokenizer files, `training.json`) into `HuggingFaceM4/reachy-gestures`. 2. In the conversation app, set `_MODEL_REVISION` in `src/reachy_mini_conversation_app/gestures.py` to the new commit hash. The app pins a revision, so robots keep the old model until they get an app update. 3. `lab/render_gifs.py` re-renders the model card GIFs in MuJoCo. It needs `reachy_mini` and `mujoco==3.3.0`. ## Rebuild the data from scratch You only need this to change the data: new gestures, new languages, a different labeller. It calls LLMs through Hugging Face Inference Providers, which bills your account. LLM sampling isn't deterministic, so you'll get new sentences, not the same ones. The published files are the record of what the model saw. Run everything from `lab/`, in a venv with `huggingface_hub pandas pyarrow`. 1. **Real sentences:** run `real_sources.py real.jsonl` (labelled set) and `real_sources_all.py real_all.jsonl` (pool). `real_test.jsonl` is a set of batches taken out of `real.jsonl` by request id; the build scripts keep those out of training. 2. **Generated sentences:** - Training batches: `generate.py gen_train.jsonl openai/gpt-oss-120b,google/gemma-4-31B-it 1 1`, then seed 3 for `gen_train2` and seed 4 for `gen_train3`. - Pools: seeds 4, 11–13 and 21–26. Pools 21–26 also listed `Qwen/Qwen3.8-27B`. - Test set: `generate.py gen_test.jsonl zai-org/GLM-5.3 1 2`. `gen_test_small.jsonl` is the 75-batch sample of it that was labelled. - The prompts, languages, topics and hard categories are at the top of `generate.py`. 3. **Labels:** run `label.py gen_train.jsonl openai/gpt-oss-120b lab_train_gptoss.jsonl`, and the same with `moonshotai/Kimi-K3` for `lab_train_kimi.jsonl`. Do this for `gen_train2` and `real` too, and label the test sets with GLM-5.3. `THREADS=16` sets the parallelism. The label prompt and gesture descriptions are in `labels.py`, `move_descriptions.json` and `gesture_phrases.json`. 4. **Splits:** `build_dataset.py` writes `data/`: the gpt-oss-only v1 splits plus the shared `test`, `test_real` and `hard`. `build_dataset2.py` then writes `splits/{gptoss,kimi,agreed,merged}/`. 5. **Upload:** `hf upload HuggingFaceM4/reachy-gestures-data splits splits --repo-type dataset`, and the same for `pools/`. `score_teachers.py` compares candidate LLM labellers on the hand-written hard cases. That comparison is how gpt-oss and Kimi were chosen. `lab_*.jsonl` and `gen_*.jsonl` in `lab/` are the raw files the published splits were built from. ## Gotchas - **The job reads `scripts/`, not `lab/`.** `pipeline.py` copies `/gesture/scripts/` into the job. After editing `train.py`, `distill_data.py`, `export.py` or `evaluate.py` in `lab/`, upload them, for example `hf upload HuggingFaceM4/reachy-gestures-data lab/train.py scripts/train.py --repo-type dataset`. Otherwise the job runs the old code. - `lab/evaluate.py` is a superset of `scripts/evaluate.py`. It adds `THREE_WAY=1`, which also scores the test rows where Kimi agrees (`lab_test_kimi.jsonl`, `lab_test_real_kimi.jsonl`). - **Teachers with billions of parameters need `TEACHER_BF16=1`** for distillation, or they run out of memory. - In job logs, `thr0` is the score with no threshold. `best` picks a threshold per set, which is optimistic. `@val` applies the val-chosen threshold to every set, and those are the honest numbers. - `lab/split_check.py` compares reading whole replies, the last 64 tokens, or each sentence. The app reads the last 64 tokens because of it. ## Sources and licences | Part | Source | Terms | |---|---|---| | Real sentences | [OpenAssistant/oasst2](https://huggingface.co/datasets/OpenAssistant/oasst2) | Apache 2.0 | | | [google-research-datasets/go_emotions](https://huggingface.co/datasets/google-research-datasets/go_emotions) | Apache 2.0 | | | [brighter-dataset/BRIGHTER-emotion-categories](https://huggingface.co/datasets/brighter-dataset/BRIGHTER-emotion-categories) | CC BY 4.0 | | Generated sentences | `openai/gpt-oss-120b`, `google/gemma-4-31B-it`, `Qwen/Qwen3.8-27B`, `zai-org/GLM-5.3` | Each model's own terms | | Labels | `openai/gpt-oss-120b`, `moonshotai/Kimi-K3`, `zai-org/GLM-5.3` | Each model's own terms | | Hard cases, scripts | Written for this project | Apache 2.0 | Reuse the real sentences under their original licences, with attribution for BRIGHTER. No recordings or transcripts of conversations with a robot are in this dataset.