-
Couldn't load subscription status.
- Fork 2.9k
feat(sim): allow loading envs from the hub #2121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for loading environments from the Hugging Face Hub in addition to the existing local environment creation. Users can now specify a Hub repository string to dynamically load and execute environment code from remote repositories.
Key changes:
- Added hub URI parsing to support flexible repository and file path specifications
- Implemented dynamic module loading for Hub-downloaded Python files
- Enhanced the
make_envfunction to handle both local and Hub environments with comprehensive error handling
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
What this does
feat(sim): allow loading envs from the hub
This allow people to upload environments on the hub, then easily load them.
from lerobot import make_env
For instance:
https://huggingface.co/jadechoghari/cartpole-env
Can be loaded as such
This design unlocks a powerful new model for collaboration. Instead of environments being locked away inside monolithic libraries, anyone can publish an
env.pyto the Hugging Face Hub, from simple toy tasks to large-scale, GPU-accelerated simulation worlds, and you can load them instantly with a single line of code.Over time, as more contributors share their work, the ecosystem of simulation environments will grow richer and more diverse. You can imagine a future where researchers push increasingly complex environments, physics-rich manipulation tasks, multi-agent worlds, photorealistic scenes, and they just work with the same LeRobot
make_env()API.