Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
The integration also makes it easier to just run models, such as cleanrl/cleanrl_utils/evals/dqn_eval.py Lines 43 to 57 in 4074eee |
|
CC @ThomasSimonini for review :) Thanks! |
simoninithomas
left a comment
There was a problem hiding this comment.
First, I want to thank you for this integration and all the work behind 🤗. The result is fantastic, especially the model card with visible hyperparameters.
I gave some insights based on Omar and Lucain and my review on how we can improve the push_to_hub part. I'm happy to help with this.**
In addition to this, we can:
- Having a downstream part (
load_from_hub), I can help with that. - Generating a json/yaml file containing the hyperparameters for reproducibility?
- Adding the library to our Hub list so that it creates a tag for people searching for cleanrl models.
|
@kinalmehta @simoninithomas and @Wauplin, thanks for the review. The
cleanrl/cleanrl_utils/evals/dqn_eval.py Line 48 in b430540
Are you thinking of loading from the yaml file somehow to run the script like
That would be great! Thank you! |
|
Hi @vwxyzjn , yes for yaml I was thinking what you mentioned.
Yes and no, because it has two advantages:
For instance with SB3 integration here's the code for load_from_hub: def load_from_hub(repo_id: str, filename: str) -> str:
"""
Download a model from Hugging Face Hub.
:param repo_id: id of the model repository from the Hugging Face Hub
:param filename: name of the model zip file from the repository
"""
try:
from huggingface_hub import hf_hub_download
except ImportError:
raise ImportError(
"You need to install huggingface_hub to use `load_from_hub`. "
"See https://pypi.org/project/huggingface-hub/ for installation."
)
# Get the model from the Hub, download and cache the model on your local disk
downloaded_model_file = hf_hub_download(
repo_id=repo_id,
filename=filename,
library_name="huggingface-sb3",
library_version="2.1",
)
return downloaded_model_file |
|
FIY From our side, we started to work on the frontend integration 🤗 |
|
Thank you @simoninithomas
Does this mean
Does
Awesome thanks! :) |
|
Hi @vwxyzjn
I'll let @simoninithomas answer on that as I am 100% sure what is counted in # downloads / month.
Yes it does ! No matter if you use |
|
@simoninithomas @kinalmehta @Wauplin thanks so much for helping with this PR. I think everything looks good at this point. We also have a good notebook ready to go https://colab.research.google.com/github/vwxyzjn/cleanrl/blob/hf-integration/docs/get-started/CleanRL_Huggingface_Integration_Demo.ipynb. Documentation can be previewed at https://cleanrl-git-hf-integration-vwxyzjn.vercel.app/get-started/zoo/ (the embed link is broken in it because it's pointing to the master branch). |
|
Merging this as is, subjecting to future PRs. We'd also probably use huggingface/blog#616 to make the announcement. Thanks for the great work, folks! |
|
Congrats ! That was a big piece of work 🎉🎉 |
|
Congratulations 👏 I was off at the end of last week. I'm preparing the blogpost for next week and we're going to have a unit using CleanRL on PPO with Edward and me using GodotRL we will have the PR this week I'll mention you to put you in the loop. |
* initial commit * pre-commit * Add hub integration * pre-commit * use CommitOperation * Fix pre-commit * refactor * push changes * refactor * fix pre-commit * pre-commit * close the env and writer after eval * support dqn jax * pre-commit * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * address comments * update docs * support dqn_atari_jax * bug fix and docs * Add cleanrl to the hf's `metadata` * include huggingface integration * test for enjoy.py * bump version, pip install extra hack python-poetry/poetry#4842 (comment) * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * Update cleanrl_utils/huggingface.py Co-authored-by: Lucain <lucainp@gmail.com> * update docs * update pre-commit * quick fix * bug fix * lazy load modules to avoid dependency issues * Add huggingface shields * Add emoji * Update docs * pre-commit * Update docs * Update docs * fix: use `algorithm_variant_filename` in model card reproduction script * typo fix * feat: add hf support for c51 * formatting fix * support pulling variant depdencies directly * support model saving for `ppo_atari_envpool_xla_jax_scan` * support `ppo_atari_envpool_xla_jax_scan` * quick change * support 'c51_jax' * formatting fix * support capture video * Add notebook * update docs * support `c51_atari` and `c51_atari_jax` * typo fix * add c51 to zoo docs * add colab badge * fix broken colab svg * pypi release * typo fix * update pre-commit * remove hf-integration reference Co-authored-by: Lucain <lucainp@gmail.com> Co-authored-by: Kinal <kinal.mehta11@gmail.com> Co-authored-by: Kinal Mehta <kgm1995@gmail.com>

Description
This PR closes #110. https://huggingface.co/cleanrl/CartPole-v1-dqn-seed1 is an example model page.
Types of changes
Checklist:
pre-commit run --all-filespasses (required).mkdocs serve.If you are adding new algorithms or your change could result in performance difference, you may need to (re-)run tracked experiments. See #137 as an example PR.
--capture-videoflag toggled on (required).mkdocs serve.width=500andheight=300).