Fix config loading in tagger
@@ -417,7 +417,8 @@ class NeuralTagger(BaseThincComponent):
def from_bytes(self, bytes_data, **exclude):
def load_model(b):
if self.model is True:
- token_vector_width = util.env_opt('token_vector_width', 128)
+ token_vector_width = util.env_opt('token_vector_width',
+ self.cfg.get('token_vector_width', 128))
self.model = self.Model(self.vocab.morphology.n_tags, token_vector_width)
self.model.from_bytes(b)
@@ -451,7 +452,8 @@ class NeuralTagger(BaseThincComponent):
def from_disk(self, path, **exclude):
def load_model(p):
if self.model is True:
- token_vector_width = util.env_opt('token_vector_width', 128)
+ token_vector_width = util.env_opt('token_vector_width',
+ self.cfg.get('token_vector_width', 128))
self.model = self.Model(self.vocab.morphology.n_tags, token_vector_width)
self.model.from_bytes(p.open('rb').read())
