From d5340e5d6165afaa1b47f2e3b1b755ec3813c16c Mon Sep 17 00:00:00 2001 From: naelsondouglas Date: Sat, 9 Oct 2021 23:39:40 -0300 Subject: [PATCH] removed a singleton-comparison pitfall --- apply_bpe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply_bpe.py b/apply_bpe.py index a847d9e..acd613d 100644 --- a/apply_bpe.py +++ b/apply_bpe.py @@ -237,7 +237,7 @@ def read_vocabulary(vocab_file, threshold): for line in vocab_file: word, freq = line.strip('\r\n ').split(' ') freq = int(freq) - if threshold == None or freq >= threshold: + if threshold is None or freq >= threshold: vocabulary.add(word) return vocabulary