Skip to content

Commit

Permalink
fixed wikisql data loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Pengcheng Yin committed Mar 2, 2019
1 parent 0f8fbca commit 5c715f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,8 @@ def save(self, path):
}
torch.save(params, path)

@staticmethod
def load(model_path, cuda=False):
@classmethod
def load(cls, model_path, cuda=False):
params = torch.load(model_path, map_location=lambda storage, loc: storage)
vocab = params['vocab']
transition_system = params['transition_system']
Expand All @@ -807,7 +807,7 @@ def load(model_path, cuda=False):
saved_state = params['state_dict']
saved_args.cuda = cuda

parser = Parser(saved_args, vocab, transition_system)
parser = cls(saved_args, vocab, transition_system)

parser.load_state_dict(saved_state)

Expand Down

0 comments on commit 5c715f4

Please sign in to comment.