Views
No views yet
pip install stable-baselines3
pip install huggingface_sb31import gym
2
3from huggingface_sb3 import load_from_hub
4from stable_baselines3 import PPO
5from stable_baselines3.common.evaluation import evaluate_policy
6from stable_baselines3.common.env_util import make_atari_env
7from stable_baselines3.common.vec_env import VecFrameStack
8
9# Retrieve the model from the hub
10## repo_id = id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name})
11## filename = name of the model zip file from the repository
12checkpoint = load_from_hub(repo_id="ThomasSimonini/ppo-SpaceInvadersNoFrameskip-v4", filename="ppo-SpaceInvadersNoFrameskip-v4.zip")
13model = PPO.load(checkpoint)