File size: 624 Bytes
eb4fc81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""FlowMo ablation without zero-context anchoring."""

import torch

from experiments.flowmo_additive.src.config import default_config
from experiments.shared.src.models.image_world_models import FlowMoAdditiveImageWorldModel


def build_model(config: object) -> FlowMoAdditiveImageWorldModel:
    return FlowMoAdditiveImageWorldModel(config)


def load_model(checkpoint_path: str, config: object | None = None) -> FlowMoAdditiveImageWorldModel:
    cfg = default_config() if config is None else config
    model = build_model(cfg)
    model.load_state_dict(torch.load(checkpoint_path, map_location="cpu"))
    return model