Views
No views yet
| Metric | Value |
|---|---|
| Mean Return | -0.10 ± 0.89 |
| Steps Trained | 60,000 |
| Algorithm | PPO |
| Environment | Blackjack-v1 |
1# pip install stable-baselines3 huggingface_hub gymnasium mujoco imageio
2from huggingface_hub import hf_hub_download
3from stable_baselines3 import PPO
4import gymnasium as gym
5import imageio
6
7# Load the winning model from HuggingFace
8model_path = hf_hub_download(repo_id="dhyuti-n/autorl-ppo-blackjack-v1", filename="model.zip")
9model = PPO.load(model_path)
10
11# Record a video rollout
12env = gym.make("Blackjack-v1", render_mode="rgb_array")
13obs, _ = env.reset(seed=0)
14frames, done = [], False
15while not done:
16 frames.append(env.render())
17 action, _ = model.predict(obs, deterministic=True)
18 obs, _, terminated, truncated, _ = env.step(action)
19 done = terminated or truncated
20env.close()
21
22imageio.mimsave("rollout.mp4", frames, fps=30)
23print("✓ Saved rollout.mp4")