Instructions to use INSAIT-Institute/LADDER-RoboLab-Long with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use INSAIT-Institute/LADDER-RoboLab-Long 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 ladder/core/common/logger/stdout.py from INSAIT-Institute/LADDER-RoboLab-Long: direct link, hf CLI and curl.
- Browser
- Download file 884 Bytes
-
https://huggingface.co/INSAIT-Institute/LADDER-RoboLab-Long/resolve/main/ladder/core/common/logger/stdout.py
- Command line
-
hf download hf://INSAIT-Institute/LADDER-RoboLab-Long/ladder/core/common/logger/stdout.py
-
curl -L -o stdout.py https://huggingface.co/INSAIT-Institute/LADDER-RoboLab-Long/resolve/main/ladder/core/common/logger/stdout.py
884 Bytes
| import contextlib | |
| import os | |
| import sys | |
| class DummyFile: | |
| def write(self, x): | |
| pass | |
| def no_stdout_within_functions(): | |
| """ | |
| Silences std output (but not error) within this context manager, | |
| even when calling external functions and processes | |
| """ | |
| # open fds | |
| null_fds = os.open(os.devnull, os.O_RDWR) | |
| # save the current file descriptors to a tuple | |
| save = os.dup(1) | |
| # put /dev/null fds on 1 (stout) but not 2 (stderr) | |
| os.dup2(null_fds, 1) | |
| # *** run the function *** | |
| yield | |
| # restore file descriptors so I can print the results | |
| os.dup2(save, 1) | |
| # close the temporary fds | |
| os.close(null_fds) | |
| def no_stdout(): | |
| """silences output within this context manager""" | |
| save_stdout = sys.stdout | |
| sys.stdout = DummyFile() | |
| yield | |
| sys.stdout = save_stdout | |