Samoed commited on
Commit
cf38609
·
1 Parent(s): afc3533

change to class method

Browse files
Files changed (1) hide show
  1. modeling_adaptor.py +3 -3
modeling_adaptor.py CHANGED
@@ -89,12 +89,12 @@ class MixtureOfAdaptors(nn.Module):
89
  )
90
  return adaptor_cache
91
 
92
- @staticmethod
93
- def load(input_path):
94
  with open(os.path.join(input_path, "config.json")) as fIn:
95
  config = json.load(fIn)
96
 
97
- adaptor = MixtureOfAdaptors(**config)
98
  adaptor.load_state_dict(
99
  torch.load(
100
  os.path.join(input_path, "adaptor.pth"), weights_only=True
 
89
  )
90
  return adaptor_cache
91
 
92
+ @classmethod
93
+ def load(cls, input_path):
94
  with open(os.path.join(input_path, "config.json")) as fIn:
95
  config = json.load(fIn)
96
 
97
+ adaptor = cls(**config)
98
  adaptor.load_state_dict(
99
  torch.load(
100
  os.path.join(input_path, "adaptor.pth"), weights_only=True