Views
No views yet
1from stable_baselines3 import PPO
2from huggingface_sb3 import load_from_hub
3import gymnasium as gym
4
5checkpoint = load_from_hub(
6 repo_id="Atharva1232/PPO-LunarLander-v3",
7 filename="ppo-LunarLander-v3.zip",
8)
9
10model = PPO.load(checkpoint)
11
12env = gym.make("LunarLander-v3", render_mode="human")
13
14obs, info = env.reset()
15
16while True:
17 action, _ = model.predict(obs, deterministic=True)
18 obs, reward, terminated, truncated, info = env.step(action)
19
20 if terminated or truncated:
21 obs, info = env.reset()