mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix vector-name loading fix
This commit is contained in:
parent
21047bde52
commit
a350be0601
|
@ -696,6 +696,7 @@ class Language(object):
|
||||||
msg = util.from_bytes(bytes_data, deserializers, {})
|
msg = util.from_bytes(bytes_data, deserializers, {})
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
def _fix_pretrained_vectors_name(nlp):
|
def _fix_pretrained_vectors_name(nlp):
|
||||||
# TODO: Replace this once we handle vectors consistently as static
|
# TODO: Replace this once we handle vectors consistently as static
|
||||||
# data
|
# data
|
||||||
|
@ -708,7 +709,8 @@ def _fix_pretrained_vectors_name(nlp):
|
||||||
nlp.vocab.vectors.name = vectors_name
|
nlp.vocab.vectors.name = vectors_name
|
||||||
else:
|
else:
|
||||||
raise ValueError(Errors.E092)
|
raise ValueError(Errors.E092)
|
||||||
link_vectors_to_models(nlp.vocab)
|
if nlp.vocab.vectors.size != 0:
|
||||||
|
link_vectors_to_models(nlp.vocab)
|
||||||
for name, proc in nlp.pipeline:
|
for name, proc in nlp.pipeline:
|
||||||
if not hasattr(proc, 'cfg'):
|
if not hasattr(proc, 'cfg'):
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user