Instructions to use AlexWortega/tinyvla-microduck-stage25 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use AlexWortega/tinyvla-microduck-stage25 with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Microduck
How to use AlexWortega/tinyvla-microduck-stage25 with Microduck:
# Replace SLOT with the slot specified in the model card (walk, stand, sitstand, ground_pick, kick_left, kick_right, roulade). sudo robotctl policy load SLOT AlexWortega/tinyvla-microduck-stage25
- Notebooks
- Google Colab
- Kaggle
Download example_client.py from AlexWortega/tinyvla-microduck-stage25: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/AlexWortega/tinyvla-microduck-stage25/resolve/main/example_client.py
- Command line
-
hf download hf://AlexWortega/tinyvla-microduck-stage25/example_client.py
-
curl -L -o example_client.py https://huggingface.co/AlexWortega/tinyvla-microduck-stage25/resolve/main/example_client.py
1.29 kB
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import argparse | |
| import base64 | |
| import json | |
| import urllib.request | |
| from pathlib import Path | |
| def main() -> None: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--url", default="http://127.0.0.1:8080") | |
| parser.add_argument("--image", type=Path, required=True) | |
| parser.add_argument( | |
| "--state", | |
| type=Path, | |
| required=True, | |
| help="JSON file containing a 61-float array.", | |
| ) | |
| parser.add_argument("--instruction", required=True) | |
| parser.add_argument("--control-index", type=int, default=0) | |
| args = parser.parse_args() | |
| payload = { | |
| "image_jpeg_base64": base64.b64encode(args.image.read_bytes()).decode(), | |
| "state": json.loads(args.state.read_text()), | |
| "instruction": args.instruction, | |
| "control_index": args.control_index, | |
| "autonomous_recovery": True, | |
| } | |
| request = urllib.request.Request( | |
| f"{args.url.rstrip('/')}/predict", | |
| data=json.dumps(payload).encode(), | |
| headers={"Content-Type": "application/json"}, | |
| method="POST", | |
| ) | |
| with urllib.request.urlopen(request) as response: | |
| result = json.load(response) | |
| print(json.dumps(result, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |