mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
* Add warning for models not found in parser
This commit is contained in:
parent
6218d8b389
commit
ef700401a6
|
@ -72,9 +72,9 @@ cdef class Parser:
|
||||||
def __init__(self, StringStore strings, model_dir, transition_system):
|
def __init__(self, StringStore strings, model_dir, transition_system):
|
||||||
if not os.path.exists(model_dir):
|
if not os.path.exists(model_dir):
|
||||||
print >> sys.stderr, "Warning: No model found at", model_dir
|
print >> sys.stderr, "Warning: No model found at", model_dir
|
||||||
self.cfg = Config(labels=[], features=[])
|
self.cfg = Config(labels={}, features=[])
|
||||||
elif not os.path.isdir(model_dir):
|
elif not os.path.isdir(model_dir):
|
||||||
self.cfg = Config(labels=[], features=[])
|
self.cfg = Config(labels={}, features=[])
|
||||||
print >> sys.stderr, "Warning: model path:", model_dir, "is not a directory"
|
print >> sys.stderr, "Warning: model path:", model_dir, "is not a directory"
|
||||||
else:
|
else:
|
||||||
self.cfg = Config.read(model_dir, 'config')
|
self.cfg = Config.read(model_dir, 'config')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user