Instructions to use NoesisLab/LITOperator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use NoesisLab/LITOperator 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
- Notebooks
- Google Colab
- Kaggle
Download sandbox/lerobot_host/lit_robot_api.py from NoesisLab/LITOperator: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/NoesisLab/LITOperator/resolve/main/sandbox/lerobot_host/lit_robot_api.py
- Command line
-
hf download hf://NoesisLab/LITOperator/sandbox/lerobot_host/lit_robot_api.py
-
curl -L -o lit_robot_api.py https://huggingface.co/NoesisLab/LITOperator/resolve/main/sandbox/lerobot_host/lit_robot_api.py
1.06 kB
| #!/usr/bin/env python3 | |
| """lit_robot_api.py — the LeRobot glue for lit_robot.LITOperator. | |
| from lit_robot_api import default_operator | |
| op = default_operator() | |
| program = op(frame) # [action, ...] open-loop | |
| A frame is the usual LeRobot observation dict: cameras, `observation. | |
| state`, task. The community tree's canonical codec root is | |
| `1g0rrr/demo3_frames_grab3`. | |
| """ | |
| import os | |
| import sys | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| SANDBOX = os.path.dirname(HERE) | |
| REPO = os.path.dirname(SANDBOX) | |
| sys.path.insert(0, os.path.join(REPO, "lit_operator")) | |
| sys.path.insert(0, SANDBOX) | |
| from lit_robot import LITOperator # noqa: E402 | |
| REPO_ID = "lerobot/community_dataset_v3" | |
| ROOT = "1g0rrr/demo3_frames_grab3" | |
| TREE = os.path.join(REPO, "weights", | |
| "LITOperator-community_open_selfboot.safetensors") | |
| def lerobot_operator(tree=TREE, repo=REPO_ID, root=ROOT): | |
| from lit_stream import make_codec | |
| codec, _info = make_codec(repo, root) | |
| return LITOperator(tree, codec) | |
| default_operator = lerobot_operator | |