def extract_lora_weights(model):
    """Extract LoRA weights from a LoraModel.

    Args:
        model: A LoraModel instance

    Returns:
        dict: LoRA weights state dict
    """
    if not isinstance(model, LoraModel):
        raise ValueError("Model must be a LoraModel instance")

    lora_state_dict = {}
    for name, param in model.named_parameters():
        if "lora_" in name:  # Only save LoRA parameters
            lora_state_dict[name] = param.data.clone()

    return lora_state_dict
Extract LoRA weights from a LoraModel.

Args:
model: A LoraModel instance

Returns:
dict: LoRA weights state dict
models/tts/metis/metis.py