-
Notifications
You must be signed in to change notification settings - Fork 679
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
Huggingface Integration #292
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! |
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.
LGTM.
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.
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. |
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-files
passes (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-video
flag toggled on (required).mkdocs serve
.width=500
andheight=300
).