manbeast3b commited on
Commit
aa82db3
·
verified ·
1 Parent(s): 96ad9a7

Update src/loss.py

Browse files
Files changed (1) hide show
  1. src/loss.py +1 -1
src/loss.py CHANGED
@@ -132,7 +132,7 @@ class LossScheduler:
132
  A.optimizer = torch.optim.SGD([A.model.scale_factor, A.model.wx, A.model.we], lr=lr)
133
 
134
  @staticmethod
135
- def load(path):A,B,C,E=torch.load(path,map_location='cpu');D=LossSchedulerModel(B,C,E);return LossScheduler(A,D)
136
  def save(A,path):B,C,D,E=A.timesteps,A.model.wx,A.model.we,A.model.scale_factor;torch.save((B,C,D,E),path)
137
  def set_timesteps(A,num_inference_steps,device='cuda'):B=device;A.xT=_A;A.e_prev=[];A.t_prev=-1;A.model=A.model.to(B);A.timesteps=A.timesteps.to(B)
138
  def scale_model_input(A,sample,*B,**C):return sample
 
132
  A.optimizer = torch.optim.SGD([A.model.scale_factor, A.model.wx, A.model.we], lr=lr)
133
 
134
  @staticmethod
135
+ def load(path):A,B,C,E=torch.load(path,map_location='cpu');D=LossSchedulerModel(B,C,scale_factor=E);return LossScheduler(A,D)
136
  def save(A,path):B,C,D,E=A.timesteps,A.model.wx,A.model.we,A.model.scale_factor;torch.save((B,C,D,E),path)
137
  def set_timesteps(A,num_inference_steps,device='cuda'):B=device;A.xT=_A;A.e_prev=[];A.t_prev=-1;A.model=A.model.to(B);A.timesteps=A.timesteps.to(B)
138
  def scale_model_input(A,sample,*B,**C):return sample