MCPcopy Create free account
hub / github.com/AlmondGod/tinyworlds / load_models

Function load_models

utils/inference_utils.py:10–20  ·  view source on GitHub ↗
(video_tokenizer_path, latent_actions_path, dynamics_path, device, use_actions=True)

Source from the content-addressed store, hash-verified

8from einops import repeat
9
10def load_models(video_tokenizer_path, latent_actions_path, dynamics_path, device, use_actions=True):
11 # Load tokenizer and dynamics, and Latent Actions if using actions
12 video_tokenizer, _vt_ckpt = load_videotokenizer_from_checkpoint(video_tokenizer_path, device)
13 video_tokenizer.eval()
14 latent_action_model = None
15 if use_actions:
16 latent_action_model, _latent_action_ckpt = load_latent_actions_from_checkpoint(latent_actions_path, device)
17 latent_action_model.eval()
18 dynamics_model, _dyn_ckpt = load_dynamics_from_checkpoint(dynamics_path, device)
19 dynamics_model.eval()
20 return video_tokenizer, latent_action_model, dynamics_model
21
22
23def visualize_inference(predicted_frames, ground_truth_frames, inferred_actions, fps, use_actions=True):

Callers 1

mainFunction · 0.90

Tested by

no test coverage detected