Model Binders
Base Binder
Base Model Binder
Abstract base class for architecture-specific weight mapping.
- class ual_adapter.binders.base.ModelBinder[source]
Abstract base class for model-specific binders.
Binders handle the mapping between AIR semantic roles and model-specific parameter names.
- map_weights(weights: Dict[str, Tensor], target_model_info: Dict[str, Any]) Dict[str, Tensor][source]
Map weights to target model naming convention.
- Parameters:
weights – Dictionary of weights with AIR or source names
target_model_info – Information about the target model
- Returns:
Dictionary with mapped weight names
Architecture Binders
Architecture-Specific Model Binders
Implementations for GPT-2, LLaMA, Pythia, and other model families.
Binder Registry
Binder Registry
Manages registration and retrieval of architecture-specific binders.
- class ual_adapter.binders.registry.BinderRegistry[source]
Registry for model binders.
Manages the mapping between architecture names and their corresponding binder implementations.
- register(architecture: str, binder_class: Type[ModelBinder]) None[source]
Register a new binder for an architecture.
- Parameters:
architecture – Architecture name (case-insensitive)
binder_class – Binder class to register
- get_binder(architecture: str) ModelBinder[source]
Get a binder instance for the specified architecture.
- Parameters:
architecture – Architecture name
- Returns:
Binder instance for the architecture