# Welcome Stable-baselines3 to the Hugging Face Hub 🤗

huggingface.co · Thomas Simonini · Jan 21, 2022

**Type:** Announcement

## Summary

Hugging Face announced an official integration with Stable-Baselines3, a popular PyTorch library for training and testing Deep Reinforcement Learning agents across diverse environments like Gym, Atari, MuJoco, and Procgen. The integration enables researchers and developers to host their saved reinforcement learning checkpoints on the Hugging Face Hub and download pre-trained community models. Interacting with the Hub requires installing the huggingface\_hub and huggingface\_sb3 packages, which supply helper methods for authentication, downloading, and uploading. Practitioners can retrieve checkpoint zip files using the load\_from\_hub function by providing the target repository identifier and filename before loading them into Stable-Baselines3 algorithms. Furthermore, users authenticated via CLI or notebook login can train policies such as PPO and publish their saved zip files to the Hub using push\_to\_hub.

## Context

Hugging Face aimed to contribute to the Deep Reinforcement Learning ecosystem by enabling researchers and enthusiasts to host and share models trained with Stable-Baselines3.

## Approach / What changed

Hugging Face created the huggingface\_sb3 library alongside huggingface\_hub to provide load\_from\_hub and push\_to\_hub functions, allowing users to pull saved checkpoint zip files directly into Stable-Baselines3 algorithms and push trained model files to Hub repositories.

## Takeaways

- The huggingface\_sb3 library provides load\_from\_hub to fetch model zip files from the Hugging Face Hub using a repository ID and filename.
- Users must authenticate via notebook\_login or huggingface-cli before pushing saved reinforcement learning models to the Hub with push\_to\_hub.
- Hugging Face plans future integrations including RL-baselines3-zoo, pre-trained RL-trained-agents collections, and Decision Transformers.

**Tags:** [Machine Learning](https://yomu.fyi/topic/machine-learning), [Open Source](https://yomu.fyi/topic/open-source), [Python](https://yomu.fyi/topic/python)

[Read original post](https://huggingface.co/blog/sb3)
