(modules_to_save: dict[str, torch.nn.Module])
| 350 | |
| 351 | |
| 352 | def _collate_lora_metadata(modules_to_save: dict[str, torch.nn.Module]) -> dict[str, Any]: |
| 353 | metadatas = {} |
| 354 | for module_name, module in modules_to_save.items(): |
| 355 | if module is not None: |
| 356 | metadatas[f"{module_name}_lora_adapter_metadata"] = module.peft_config["default"].to_dict() |
| 357 | return metadatas |
| 358 | |
| 359 | |
| 360 | def compute_density_for_timestep_sampling( |
no test coverage detected
searching dependent graphs…