import gym
from huggingface_sb3 import load_from_hub
from stable_baselines3 import PPO
from stable_baselines3.common.evaluation import evaluate_policy
# Retrieve the model from the hub## repo_id = id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name})## filename = name of the model zip file from the repository
checkpoint = load_from_hub(repo_id="kingabzpro/Full-Force-MountainCar-v0", filename="Full-Force-MountainCar-v0.zip")
model = PPO.load(checkpoint)
# Evaluate the agent
eval_env = gym.make('MountainCar-v0')
mean_reward, std_reward = evaluate_policy(model, eval_env, n_eval_episodes=10, deterministic=True)
print(f"mean_reward={mean_reward:.2f} +/- {std_reward}")
# Watch the agent play
obs = eval_env.reset()
for i inrange(1000):
action, _state = model.predict(obs)
obs, reward, done, info = eval_env.step(action)
eval_env.render()
if done:
obs = eval_env.reset()
eval_env.close()
Runs of kingabzpro Full-Force-MountainCar-v0 on huggingface.co
36
Total runs
0
24-hour runs
1
3-day runs
1
7-day runs
33
30-day runs
More Information About Full-Force-MountainCar-v0 huggingface.co Model
Full-Force-MountainCar-v0 huggingface.co
Full-Force-MountainCar-v0 huggingface.co is an AI model on huggingface.co that provides Full-Force-MountainCar-v0's model effect (), which can be used instantly with this kingabzpro Full-Force-MountainCar-v0 model. huggingface.co supports a free trial of the Full-Force-MountainCar-v0 model, and also provides paid use of the Full-Force-MountainCar-v0. Support call Full-Force-MountainCar-v0 model through api, including Node.js, Python, http.
Full-Force-MountainCar-v0 huggingface.co is an online trial and call api platform, which integrates Full-Force-MountainCar-v0's modeling effects, including api services, and provides a free online trial of Full-Force-MountainCar-v0, you can try Full-Force-MountainCar-v0 online for free by clicking the link below.
kingabzpro Full-Force-MountainCar-v0 online free url in huggingface.co:
Full-Force-MountainCar-v0 is an open source model from GitHub that offers a free installation service, and any user can find Full-Force-MountainCar-v0 on GitHub to install. At the same time, huggingface.co provides the effect of Full-Force-MountainCar-v0 install, users can directly use Full-Force-MountainCar-v0 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Full-Force-MountainCar-v0 install url in huggingface.co: