Don't expect parser model

This commit is contained in:
Matthew Honnibal 2016-09-26 18:09:33 +02:00
parent ee6fa106da
commit e07b9665f7
1 changed files with 3 additions and 2 deletions

View File

@ -80,8 +80,9 @@ cdef class ParserModel(AveragedPerceptron):
cdef class Parser:
@classmethod
def load(cls, path, Vocab vocab, moves_class):
with (path / 'config.json').open() as file_:
cfg = json.load(file_)
if (path / 'config.json').exists():
with (path / 'config.json').open() as file_:
cfg = json.load(file_)
moves = moves_class(vocab.strings, cfg['labels'])
templates = get_templates(cfg['features'])
model = ParserModel(templates)