xnn.common.finetune.lora.lora_options#

xnn.common.finetune.lora.lora_options(spec)[source]#

Normalize a model.extra["lora"] entry to inject_lora() keywords.

True gives the defaults, an int sets the rank, a mapping may hold rank, alpha, init_std, exclude (module-name patterns), freeze and trainable (parameter-name patterns kept trainable).

Parameters:

spec (Any)

Return type:

dict[str, Any]