(state_dict)
| 67 | |
| 68 | |
| 69 | def initialize_dummy_state_dict(state_dict): |
| 70 | if not all(v.device.type == "meta" for _, v in state_dict.items()): |
| 71 | raise ValueError("`state_dict` has non-meta values.") |
| 72 | return {k: torch.randn(v.shape, device=torch_device, dtype=v.dtype) for k, v in state_dict.items()} |
| 73 | |
| 74 | |
| 75 | @require_peft_backend |
no outgoing calls