From e67ba8ae08ee5a7a1f62f0dd2a8d1f4771083e27 Mon Sep 17 00:00:00 2001 From: Lydia Nishimwe Date: Thu, 25 Jul 2024 00:23:28 +0200 Subject: [PATCH] Update dictionary.py revert back to old solution --- fairseq/data/dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fairseq/data/dictionary.py b/fairseq/data/dictionary.py index 745db16e43..9b893c858e 100644 --- a/fairseq/data/dictionary.py +++ b/fairseq/data/dictionary.py @@ -131,7 +131,7 @@ def add_symbol(self, word, n=1, overwrite=True): self.count[idx] = self.count[idx] + n return idx else: - idx = len(self.indices) + idx = len(self.symbols) self.indices[word] = idx self.symbols.append(word) self.count.append(n)