Closed simoninithomas closed 2 years ago
@osanseviero : "Then the approach sounds good. One suggestion to avoid having to do this twice, is that I would unzip the files. Having them within a zip is not great I feel, specially since you have 0 idea what is in there without download+unzipping (similar to how we discussed spaCy works atm)"
So the described process is only for SB team models.
The idea is:
enjoy.py:
if not found then:
local_dir = f"rl-trained-agents/{algo}/{env_id}_1"
clone_from = f"sb3/{algo}-{env_id}"
repo = Repository(local_dir, clone_from)
# I want to get my custom ppo-CartPole v-1
# This download the model and put it in logs/ppo/CartPole-v1_1
!python utils/load_from_hf.py --algo ppo --env CartPole-v1 --model-id="ThomasSimonini/ppo-Cartpole-v1"
!python enjoy.py --algo ppo --env CartPole-v1 --no-render
But for these official saved models, we just modify one line of code of enjoy.py (if the folder is not found and the model searched is from rl-trained-agents then download it from the hub) that's why we can put it directly on rl-baselines-zoo without having an external repo like huggingface_sb3
This is super cool, really looking forward to this!
i agree that you should store the uncompressed files whenever possible (to get git history etc)
Is this issue resolved? Can we close this?
Yes, this is more of a discussion on good practices rather than an issue with the core library. This info will be useful for the new docs as well cc @NimaBoscarino
Hi! For people who upload a lot of models on the Hub, I'm working on the upload of about 160 RL models (rl-trained-agents) :fire: so I will not do it by hand :sweat_smile:
The github repository containing all the models is like this:
Each model is like this (for instance
/ppo/SpaceInvadersNoFrameskip-v4
:The process I'm defining is this way (pseudocode) for each {algo}/{env_id}:
Do you think it's a good process or you have some better solutions? Thanks for your feedback