mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-21 07:30:02 +08:00
only save if option is enabled
This commit is contained in:
parent
f5d394214d
commit
1ca0bcd3a7
@ -188,7 +188,7 @@ class Hypernetwork:
|
|||||||
optimizer_saved_dict['optimizer_name'] = self.optimizer_name
|
optimizer_saved_dict['optimizer_name'] = self.optimizer_name
|
||||||
|
|
||||||
torch.save(state_dict, filename)
|
torch.save(state_dict, filename)
|
||||||
if self.optimizer_state_dict:
|
if shared.opts.save_optimizer_state and self.optimizer_state_dict:
|
||||||
optimizer_saved_dict['hash'] = sd_models.model_hash(filename)
|
optimizer_saved_dict['hash'] = sd_models.model_hash(filename)
|
||||||
optimizer_saved_dict['optimizer_state_dict'] = self.optimizer_state_dict
|
optimizer_saved_dict['optimizer_state_dict'] = self.optimizer_state_dict
|
||||||
torch.save(optimizer_saved_dict, filename + '.optim')
|
torch.save(optimizer_saved_dict, filename + '.optim')
|
||||||
|
Loading…
Reference in New Issue
Block a user