From fcc205ba43489315df265fedb39e91f08ed1f414 Mon Sep 17 00:00:00 2001 From: Ander Corral Date: Thu, 16 Feb 2023 17:27:21 +0100 Subject: [PATCH] Fixed build vocab indexing issue (#2318) --- onmt/bin/build_vocab.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/onmt/bin/build_vocab.py b/onmt/bin/build_vocab.py index 6f2611a5e8..a9bbe7e7cb 100644 --- a/onmt/bin/build_vocab.py +++ b/onmt/bin/build_vocab.py @@ -65,9 +65,9 @@ def build_sub_vocab(corpora, transforms, opts, n_sample, stride, offset): if 'feats' in maybe_example['src']: src_feats_lines = maybe_example['src']['feats'] - for i in range(opts.n_src_feats): - sub_counter_src_feats[i].update( - src_feats_lines[i].split(' ')) + for k in range(opts.n_src_feats): + sub_counter_src_feats[k].update( + src_feats_lines[k].split(' ')) else: src_feats_lines = []