Skip to content

float_policy

float_policy

Floating point policy checkpoint restoration.

FloatCheckpointLoader

FloatCheckpointLoader(device, checkpoint_path, checkpoint_name)

Bases: BaseCheckpointLoader

Restore a floating-point policy checkpoint, including configuration, tokenizer, normalizer (inside the policy class), and policy weights.

Initialize and restore the policy checkpoint.

Source code in src/versatil/checkpoint_loading/float_policy.py
def __init__(
    self,
    device: torch.device,
    checkpoint_path: str,
    checkpoint_name: str,
) -> None:
    """Initialize and restore the policy checkpoint."""
    super().__init__(device=device, checkpoint_path=checkpoint_path)
    self._checkpoint_name = checkpoint_name
    self._load_model()