Views
No views yet
1import gymnasium as gym
2from stable_baselines3 import PPO
3
4# Load model from the Hub
5model = PPO.load("koteiketuc/ppo_lunar_lander_v3/ppo_lunar_lander_v3", custom_objects={"lr_schedule": 0.0003, "clip_range": 0.1})
6
7# Create environment
8env = gym.make("LunarLander-v3")
9obs, info = env.reset()
10
11# Play an episode
12while True:
13 action, _ = model.predict(obs, deterministic=True)
14 obs, reward, terminated, truncated, info = env.step(action)
15 if terminated or truncated:
16 break
17
18env.close()