| # folding-final-handler | |
| Custom HuggingFace Inference Endpoint handler that serves the | |
| [`lerobot-data-collection/folding_final`](https://huggingface.co/lerobot-data-collection/folding_final) | |
| Οβ.β policy for bimanual OpenArm cloth-folding. | |
| Weights are *not* duplicated into this repo β `handler.py` pulls them | |
| from the upstream repo at container cold-start via | |
| `huggingface_hub.snapshot_download`. | |
| ## Wire format | |
| POST JSON to the endpoint URL with header `Authorization: Bearer hf_β¦`: | |
| ```json | |
| { | |
| "inputs": { | |
| "images": { | |
| "left_wrist": "<base64 JPEG>", | |
| "right_wrist": "<base64 JPEG>", | |
| "base": "<base64 JPEG>" | |
| }, | |
| "state": [16 floats], | |
| "prompt": "fold the towel" | |
| } | |
| } | |
| ``` | |
| Response: | |
| ```json | |
| { | |
| "actions": [[16 floats] Γ 30], | |
| "chunk_len": 30, | |
| "action_dim": 16, | |
| "action_feature_names": ["right_joint_1.pos", ..., "left_gripper.pos"] | |
| } | |
| ``` | |
| State + action layout matches | |
| `folding_final.config.action_feature_names`: right joints 1β7, right | |
| gripper, left joints 1β7, left gripper. | |
| ## Why this repo exists | |
| To keep the deployed endpoint code under our control without duplicating | |
| ~8 GB of safetensors. handler.py is the only thing that ever changes. | |