Views
No views yet
ppo_policy.pth)vae_model.pth)hmm_model.pth)1import torch
2from training.online_rl import train_online_ppo_with_pretrained_models
3
4# Load the complete model
5device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
6
7# Load individual components
8ppo_checkpoint = torch.load('ppo_policy.pth', map_location=device, weights_only=False)
9vae_data = torch.load('vae_model.pth', map_location=device, weights_only=False)
10hmm_data = torch.load('hmm_model.pth', map_location=device, weights_only=False)
11
12# Use for inference or continued training
13results = train_online_ppo_with_pretrained_models(
14 env_name="MiniHack-Room-Random-15x15-v0",
15 vae_repo_id="CatkinChen/nethack-vae-hmm",
16 hmm_repo_id="CatkinChen/nethack-hmm",
17 test_mode=True
18)