rlightning.models.openvla.openvla_utils

Utils for evaluating OpenVLA or fine-tuned OpenVLA policies.

rlightning.models.openvla.openvla_utils.check_identical_files(path1: str | Path, path2: str | Path) bool[source]

Check if two files are identical in content.

Parameters:
  • path1 – Path to the first file

  • path2 – Path to the second file

Returns:

True if files are identical, False otherwise

Return type:

bool

rlightning.models.openvla.openvla_utils.check_model_logic_mismatch(pretrained_checkpoint: str) None[source]

Check and sync model logic files between current code and checkpoint.

Handles the relationship between current and checkpoint versions of both modeling_prismatic.py and configuration_prismatic.py: - If checkpoint file exists and differs: creates backup and copies current version - If checkpoint file doesn’t exist: copies current version

Parameters:

pretrained_checkpoint – Path to the checkpoint directory

rlightning.models.openvla.openvla_utils.update_auto_map(pretrained_checkpoint: str) None[source]

Update the AutoMap configuration in the checkpoint config.json file.

This loads the config.json file inside the checkpoint directory and overwrites the AutoConfig and AutoModelForVision2Seq fields to use OpenVLA-specific classes.

Parameters:

pretrained_checkpoint – Path to the checkpoint directory