get_adapter_state_dict¶
- torchtune.modules.peft.get_adapter_state_dict(state_dict: Dict[str, Any], device: Optional[str] = 'cpu') Dict[str, Any] [source]¶
Return the subset of the full state_dict from a model that correspond to an adapter. Assumes that “lora” and “magnitude” are unique names for adapter parameters, and that the state_dict is not sharded. All returned parameters are moved to CPU.