Views
No views yet
1import gymnasium as gym
2from stable_baselines3 import PPO
3from huggingface_hub import hf_hub_download
4
5model_path = hf_hub_download(repo_id="AntonDergunov/LunarLander_PPO", filename="model.zip")
6model = PPO.load(model_path, device="cpu")
7
8env = gym.make("LunarLander-v3")
9obs, info = env.reset()
10
11for _ in range(1000):
12 action, _ = model.predict(obs, deterministic=True)
13 obs, reward, terminated, truncated, info = env.step(action)
14
15 if terminated or truncated:
16 obs, info = env.reset()