You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we saw we got good results after the training, we can publish our trained model on the hub 🤗 with one line of code.
485
485
486
-
📚 The libraries documentation 👉 https://github.com/huggingface/huggingface_sb3/tree/main#hugging-face--x-stable-baselines3-v20
486
+
📚 The libraries documentation 👉 https://github.com/huggingface/huggingface_sb3/tree/main#hugging-face--x-stable-baselines3-v30
487
487
488
488
Here's an example of a Model Card (with Space Invaders):
489
489
@@ -521,7 +521,7 @@ Let's fill the `package_to_hub` function:
521
521
-`model`: our trained model.
522
522
-`model_name`: the name of the trained model that we defined in `model_save`
523
523
-`model_architecture`: the model architecture we used, in our case PPO
524
-
-`env_id`: the name of the environment, in our case `LunarLander-v2`
524
+
-`env_id`: the name of the environment, in our case `LunarLander-v3`
525
525
-`eval_env`: the evaluation environment defined in eval_env
526
526
-`repo_id`: the name of the Hugging Face Hub Repository that will be created/updated `(repo_id = {username}/{repo_name})`
527
527
@@ -537,7 +537,7 @@ from stable_baselines3.common.env_util import make_vec_env
537
537
from huggingface_sb3 import package_to_hub
538
538
539
539
## TODO: Define a repo_id
540
-
## repo_id is the id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
540
+
## repo_id is the id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v3
541
541
repo_id =
542
542
543
543
#TODO: Define the name of the environment
@@ -559,7 +559,7 @@ package_to_hub(model=model, # Our trained model
559
559
model_architecture=model_architecture, # The model architecture we used: in our case PPO
560
560
env_id=env_id, # Name of the environment
561
561
eval_env=eval_env, # Evaluation Environment
562
-
repo_id=repo_id, # id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
562
+
repo_id=repo_id, # id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v3
563
563
commit_message=commit_message)
564
564
```
565
565
@@ -577,18 +577,18 @@ from huggingface_sb3 import package_to_hub
577
577
578
578
# PLACE the variables you've just defined two cells above
579
579
# Define the name of the environment
580
-
env_id ="LunarLander-v2"
580
+
env_id ="LunarLander-v3"
581
581
582
582
#TODO: Define the model architecture we used
583
583
model_architecture ="PPO"
584
584
585
585
## Define a repo_id
586
-
## repo_id is the id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
586
+
## repo_id is the id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v3
587
587
## CHANGE WITH YOUR REPO ID
588
-
repo_id ="ThomasSimonini/ppo-LunarLander-v2"# Change with your repo id, you can't push with mine 😄
588
+
repo_id ="ThomasSimonini/ppo-LunarLander-v3"# Change with your repo id, you can't push with mine 😄
model_architecture=model_architecture, # The model architecture we used: in our case PPO
601
601
env_id=env_id, # Name of the environment
602
602
eval_env=eval_env, # Evaluation Environment
603
-
repo_id=repo_id, # id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
603
+
repo_id=repo_id, # id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v3
604
604
commit_message=commit_message,
605
605
)
606
606
```
@@ -613,7 +613,7 @@ Congrats 🥳 you've just trained and uploaded your first Deep Reinforcement Lea
613
613
614
614
Under the hood, the Hub uses git-based repositories (don't worry if you don't know what git is), which means you can update the model with new versions as you experiment and improve your agent.
615
615
616
-
Compare the results of your LunarLander-v2 with your classmates using the leaderboard 🏆 👉 https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard
616
+
Compare the results of your LunarLander-v3 with your classmates using the leaderboard 🏆 👉 https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard
617
617
618
618
## Load a saved LunarLander model from the Hub 🤗
619
619
Thanks to [ironbar](https://github.com/ironbar) for the contribution.
@@ -678,7 +678,7 @@ Here are some ideas to achieve so:
678
678
* Check the [Stable-Baselines3 documentation](https://stable-baselines3.readthedocs.io/en/master/modules/dqn.html) and try another model such as DQN.
679
679
***Push your new trained model** on the Hub 🔥
680
680
681
-
**Compare the results of your LunarLander-v2 with your classmates** using the [leaderboard](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard) 🏆
681
+
**Compare the results of your LunarLander-v3 with your classmates** using the [leaderboard](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard) 🏆
682
682
683
683
Is moon landing too boring for you? Try to **change the environment**, why not use MountainCar-v0, CartPole-v1 or CarRacing-v0? Check how they work [using the gym documentation](https://www.gymlibrary.dev/) and have fun 🎉.
0 commit comments