set_trainable_params¶
- torchtune.modules.peft.set_trainable_params(model: Module, adapter_params: Union[Dict[str, Any], Set]) None [source]¶
Set trainable parameters for an nn.Module based on a state dict of adapter parameters.
- Parameters:
model (nn.Module) – Instance of model class containing some adapter params.
adapter_params (Union[Dict[str, Any], Set]) – State dict mapping adapter key names to their respective nn.Parameters (i.e. outputs of
get_adapter_params()
.)
- Returns:
None