Skip to content

Commit a5f858d

Browse files
committed
foo
1 parent 1f5367d commit a5f858d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stanza/models/depparse/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ class EnsembleGraphParser(BaseParser):
359359
def __init__(self, args, vocab, models):
360360
super().__init__(args, vocab)
361361
self.models = nn.ModuleList(models)
362+
self.fallback = self.models[0].fallback
362363

363364
def get_params(self, skip_modules):
364365
params = []
@@ -406,7 +407,7 @@ def forward(self, word, word_mask, wordchars, wordchars_mask, upos, xpos, ufeats
406407
def predict(self, word, word_mask, wordchars, wordchars_mask, upos, xpos, ufeats, pretrained, lemma, head, deprel, word_orig_idx, sentlens, wordlens, text):
407408
batch_size = word.size(0)
408409
_, preds = self(word, word_mask, wordchars, wordchars_mask, upos, xpos, ufeats, pretrained, lemma, head, deprel, word_orig_idx, sentlens, wordlens, text)
409-
pred_tokens = GraphParser.decode_graph_predictions(self.vocab['deprel'], batch_size, preds, sentlens)
410+
pred_tokens = GraphParser.decode_graph_predictions(self.vocab['deprel'], self.fallback, batch_size, preds, sentlens)
410411
return pred_tokens
411412

412413
def get_device(self):

0 commit comments

Comments
 (0)