diff --git a/src/adapters/methods/adapter_layer_base.py b/src/adapters/methods/adapter_layer_base.py index 7a70a4d764..24069586a4 100644 --- a/src/adapters/methods/adapter_layer_base.py +++ b/src/adapters/methods/adapter_layer_base.py @@ -117,6 +117,9 @@ class ComposableAdapterLayerBase(AdapterLayerBase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self._init_mapping() + + def _init_mapping(self): self.composition_to_func_map = { Stack: self.compose_stack, Fuse: self.compose_fuse, diff --git a/src/adapters/methods/bottleneck.py b/src/adapters/methods/bottleneck.py index b802e960e2..7ec097d806 100644 --- a/src/adapters/methods/bottleneck.py +++ b/src/adapters/methods/bottleneck.py @@ -48,6 +48,7 @@ def __init__(self, location_key: str): self.location_key = location_key def init_adapters(self, model_config, adapters_config): + self._init_mapping() self.model_config = model_config self.adapters_config = adapters_config self.adapters = nn.ModuleDict(dict())