def merge_adapter_weights(base_model, adapter_weights, device):
    """Merge adapter weights into the base model.

    Args:
        base_model: MetisStage1 model instance
        adapter_weights: dict of adapter weights (adapter name: cond_emb)
    """

    for name, param in base_model.named_parameters():
        if "cond_adapter" in name:
            # print(name)
            param.data = adapter_weights["model." + name]
            # to device
            param.data = param.data.to(device)

    return base_model
Merge adapter weights into the base model.

Args:
base_model: MetisStage1 model instance
adapter_weights: dict of adapter weights (adapter name: cond_emb)
models/tts/metis/metis.py