cerebras.modelzoo.common.utils.model.lora.make_model_lora#
- cerebras.modelzoo.common.utils.model.lora.make_model_lora(model, lora_params)[source]#
Create a Low Rank Adaptation (LoRA) model from a non-LoRA model. Note that the original non-LoRA model may be modified through this process.
- Parameters
model (torch.nn.Module) – Initial model to make LoRA
lora_params (Union[dict, List[dict], cerebras.modelzoo.common.utils.model.lora.LoraConfig, List[cerebras.modelzoo.common.utils.model.lora.LoraConfig]]) – LoRA parameters (in the form of a dict or list of dicts) which dictate how the supplied model will be converted into a LoRA model. The parameters should align with LoraConfig.
- Returns
LoRA model