mirror of
https://github.com/explosion/spaCy.git
synced 2025-06-30 18:03:04 +03:00
Fix mistake loading GloVe vectors. GloVe vectors now loaded by default if present, as promised.
This commit is contained in:
parent
bfe5cb1244
commit
ddeabd76c4
|
@ -25,7 +25,9 @@ def load(name, **overrides):
|
||||||
path = util.match_best_version(target_name, target_version, path)
|
path = util.match_best_version(target_name, target_version, path)
|
||||||
|
|
||||||
if isinstance(overrides.get('vectors'), basestring):
|
if isinstance(overrides.get('vectors'), basestring):
|
||||||
vectors = util.match_best_version(overrides.get('vectors'), None, path)
|
vectors_path = util.match_best_version(overrides.get('vectors'), None, path)
|
||||||
|
overrides['vectors'] = lambda nlp: nlp.vocab.load_vectors_from_bin_loc(
|
||||||
|
vectors_path / 'vocab' / 'vec.bin')
|
||||||
|
|
||||||
cls = get_lang_class(target_name)
|
cls = get_lang_class(target_name)
|
||||||
return cls(path=path, **overrides)
|
return cls(path=path, **overrides)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user