transformer_lens.tools.model_registry.verification module¶
Verification tracking for model compatibility.
This module provides dataclasses and utilities for tracking which models have been verified to work with TransformerLens.
- class transformer_lens.tools.model_registry.verification.VerificationHistory(records: list[~transformer_lens.tools.model_registry.verification.VerificationRecord] = <factory>, last_updated: ~datetime.datetime | None = None)¶
Bases:
objectHistory of all model verifications.
- records¶
List of all verification records
- last_updated¶
When this history was last updated
- Type:
datetime.datetime | None
- add_record(record: VerificationRecord) None¶
Add a new verification record.
- Parameters:
record – The verification record to add
- classmethod from_dict(data: dict) VerificationHistory¶
Create from a dictionary.
- get_record(model_id: str) VerificationRecord | None¶
Get the most recent valid verification record for a model.
- Parameters:
model_id – The model ID to look up
- Returns:
The verification record, or None if not found or invalidated
- invalidate(model_id: str, reason: str) bool¶
Invalidate the most recent verification for a model.
- Parameters:
model_id – The model ID to invalidate
reason – Reason for invalidation
- Returns:
True if a record was invalidated, False if not found
- is_verified(model_id: str) bool¶
Check if a model has a valid verification.
- Parameters:
model_id – The model ID to check
- Returns:
True if the model has a valid (non-invalidated) verification
- last_updated: datetime | None = None¶
- records: list[VerificationRecord]¶
- to_dict() dict¶
Convert to a JSON-serializable dictionary.
- class transformer_lens.tools.model_registry.verification.VerificationRecord(model_id: str, verified_date: date, architecture_id: str = 'Unknown', verified_by: str | None = None, transformerlens_version: str | None = None, notes: str | None = None, invalidated: bool = False, invalidation_reason: str | None = None)¶
Bases:
objectA record of a model verification.
- model_id¶
The HuggingFace model ID that was verified
- Type:
str
- architecture_id¶
The architecture type of the model
- Type:
str
- verified_date¶
Date when verification was performed
- Type:
datetime.date
- verified_by¶
Who performed the verification (user, CI, etc.)
- Type:
str | None
- transformerlens_version¶
Version of TransformerLens used
- Type:
str | None
- notes¶
Optional notes about the verification
- Type:
str | None
- invalidated¶
Whether this verification has been invalidated
- Type:
bool
- invalidation_reason¶
Reason for invalidation if applicable
- Type:
str | None
- architecture_id: str = 'Unknown'¶
- classmethod from_dict(data: dict) VerificationRecord¶
Create from a dictionary.
- invalidated: bool = False¶
- invalidation_reason: str | None = None¶
- model_id: str¶
- notes: str | None = None¶
- to_dict() dict¶
Convert to a JSON-serializable dictionary.
- transformerlens_version: str | None = None¶
- verified_by: str | None = None¶
- verified_date: date¶