transformer_lens.tools.model_registry.alias_drift module¶
MODEL_ALIASES drift checker.
Compares the legacy MODEL_ALIASES / OFFICIAL_MODEL_NAMES in transformer_lens/supported_models.py against the model registry in data/supported_models.json, and reports:
Models in MODEL_ALIASES but NOT in the registry
Models in the registry (status=1, verified) but NOT in MODEL_ALIASES
Summary statistics
- Usage:
python -m transformer_lens.tools.model_registry.alias_drift python -m transformer_lens.tools.model_registry.alias_drift –format json python -m transformer_lens.tools.model_registry.alias_drift –all-statuses –exit-code
- class transformer_lens.tools.model_registry.alias_drift.DriftReport(in_aliases_not_registry: list[str] = <factory>, in_registry_not_aliases: list[str] = <factory>)¶
Bases:
objectResult of comparing MODEL_ALIASES with the model registry.
- property has_drift: bool¶
- in_aliases_not_registry: list[str]¶
- in_registry_not_aliases: list[str]¶
- to_dict() dict¶
- transformer_lens.tools.model_registry.alias_drift.check_drift(verified_only: bool = True) DriftReport¶
Compare MODEL_ALIASES with the model registry.
- Parameters:
verified_only – If True, only consider registry models with status=1 when checking for models missing from MODEL_ALIASES.
- Returns:
DriftReport with all discrepancies.
- transformer_lens.tools.model_registry.alias_drift.main() None¶
CLI entry point for the drift checker.
- transformer_lens.tools.model_registry.alias_drift.print_report(report: DriftReport) None¶
Print a human-readable drift report to stdout.