AntonDergunov/CartPole_PPO

This is a reinforcement learning agent trained with PPO on CartPole-v1 using Stable-Baselines3.

Usage

import gymnasium as gym
from stable_baselines3 import PPO
from huggingface_hub import hf_hub_download

model_path = hf_hub_download(repo_id="AntonDergunov/CartPole_PPO", filename="model.zip")
model = PPO.load(model_path, device="cpu")

env = gym.make("CartPole-v1")
obs, info = env.reset()

for _ in range(1000):
    action, _ = model.predict(obs, deterministic=True)
    obs, reward, terminated, truncated, info = env.step(action)

    if terminated or truncated:
        obs, info = env.reset()
Downloads last month
3
Video Preview
loading

Evaluation results