Instructions to use ReasoningKingdom/LITOperator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use ReasoningKingdom/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
Sync the cleaned tree
Browse files18 unmodified lines192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120222324252627282930313233343518 unmodified linesfrom lit_codec import FeatureCodec
HERE = os.path.dirname(os.path.abspath(__file__))LIB_NAME = "liblit.dylib" if sys.platform == "darwin" else "liblit.so"LIB = C.CDLL(os.path.join(HERE, LIB_NAME))
# ---------------------------------------------------------------- ABIclass LitKey(C.Structure): _fields_ = [("hi", C.c_uint64), ("lo", C.c_uint64)]
class LitAction(C.Structure): _fields_ = [ ("kind", C.c_uint32), ("id", C.c_uint32), ("x", C.c_uint32), ("y", C.c_uint32), ("cost", C.c_uint32), ]
class LitNodeView(C.Structure): _fields_ = [ ("parent", C.c_uint32), ("depth", C.c_uint32), ("g", C.c_uint64), ("key", LitKey), ("act", LitAction), ("first_child", C.c_uint32), ("next_sibling", C.c_uint32), ("goal", C.c_uint8), ("dead", C.c_uint8), ("expanded", C.c_uint8), ]
class LitSearchOpts(C.Structure): _fields_ = [("max_steps", C.c_uint64), ("max_nodes", C.c_uint64)]
class LitPath(C.Structure): _fields_ = [ ("acts", C.POINTER(LitAction)), ("n", C.c_size_t), ("pops", C.c_uint64), ("nodes", C.c_uint64), ]
ROOT_FN = C.CFUNCTYPE( C.c_int, C.c_void_p, C.POINTER(LitKey), C.POINTER(C.c_int), C.POINTER(C.c_int))ACTIONS_FN = C.CFUNCTYPE( C.c_int, C.c_void_p, C.POINTER(LitAction), C.c_size_t, C.POINTER(C.POINTER(LitAction)), C.POINTER(C.c_size_t))EXPAND_FN = C.CFUNCTYPE( C.c_int, C.c_void_p, C.POINTER(LitAction), C.c_size_t, C.POINTER(LitAction), C.POINTER(C.c_uint64), C.c_size_t, C.POINTER(LitKey), C.POINTER(C.c_int), C.POINTER(C.c_int))EVAL_FN = C.CFUNCTYPE( C.c_int, C.c_void_p, C.POINTER(LitAction), C.c_size_t, C.POINTER(LitAction), C.c_uint64, C.POINTER(LitKey), C.POINTER(C.c_int), C.POINTER(C.c_int))SEEK_FN = C.CFUNCTYPE(C.c_int, C.c_void_p, C.POINTER(LitKey))EVENT_FN = C.CFUNCTYPE( None, C.c_void_p, C.POINTER(LitAction), C.c_size_t, C.c_uint64, C.c_uint64, C.c_size_t, C.c_double, C.c_double, C.c_int)CHOOSE_FN = C.CFUNCTYPE( C.c_int, C.c_void_p, C.POINTER(LitNodeView), C.c_size_t, C.POINTER(C.c_uint32))SCORE_FN = C.CFUNCTYPE( C.c_int, C.c_void_p, C.POINTER(LitNodeView), C.c_size_t, C.POINTER(C.c_uint64))
class LitHost(C.Structure): _fields_ = [ ("ctx", C.c_void_p), ("root", ROOT_FN), ("actions", ACTIONS_FN), ("expand", EXPAND_FN), ("eval", EVAL_FN), ("seek", SEEK_FN), ("event", EVENT_FN), ("choose", CHOOSE_FN), ("score", SCORE_FN), ]
LIB.lit_search_new.argtypes = [C.POINTER(LitHost)]LIB.lit_search_new.restype = C.c_void_pLIB.lit_search_continue.argtypes = [ C.c_void_p, C.POINTER(LitSearchOpts), C.POINTER(LitPath)]LIB.lit_search_continue.restype = C.c_intLIB.lit_search_save_json.argtypes = [C.c_void_p, C.c_char_p]LIB.lit_search_save_json.restype = C.c_intLIB.lit_search_free.argtypes = [C.c_void_p]LIB.lit_path_free.argtypes = [C.POINTER(LitPath)]
LIT_SEARCH_FOUND = 0LIT_SEARCH_EMPTY = 1LIT_SEARCH_BUDGET = 2SANDBOX = os.path.dirname(HERE)REPO = os.path.dirname(SANDBOX)OP = os.path.join(REPO, "lit_operator")if OP not in sys.path: sys.path.insert(0, OP)
from lit_world import ( # noqa: E402 ACTIONS_FN, CHOOSE_FN, EVAL_FN, EVENT_FN, EXPAND_FN, LIB, LIT_SEARCH_BUDGET, LIT_SEARCH_EMPTY, LIT_SEARCH_FOUND, LitAction, LitHost, LitKey, LitNodeView, LitPath, LitSearchOpts, ROOT_FN, SCORE_FN, SEEK_FN)
# ------------------------------------------------------------- the hostsandbox/lerobot_host/lit_libero.py+11-99