mirror of https://github.com/explosion/spaCy.git
Add more validation for model meta
This commit is contained in:
parent
2e28982e28
commit
173089a45a
|
@ -169,8 +169,8 @@ def get_model_meta(path):
|
|||
raise IOError("Could not read meta.json from %s" % meta_path)
|
||||
meta = read_json(meta_path)
|
||||
for setting in ['lang', 'name', 'version']:
|
||||
if setting not in meta:
|
||||
raise ValueError('No %s setting found in model meta.json' % setting)
|
||||
if setting not in meta or not meta[setting]:
|
||||
raise ValueError('No valid '%s' setting found in model meta.json' % setting)
|
||||
return meta
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue