From b4c255babaae72d6a03b4c8e8e7e25f6ab0a19a0 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Wed, 27 Jul 2022 16:07:36 +0200 Subject: [PATCH] OCD cosmectics --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 76aeebd..77b1b22 100755 --- a/main.py +++ b/main.py @@ -212,10 +212,10 @@ class TaskPicoCLVR(Task): def vocabulary_size(self): return len(self.token2id) - def generate(self, descr_primer, model, nb_tokens): + def generate(self, primer_descr, model, nb_tokens): results = autoregression( model, self.batch_size, - 1, nb_tokens, primer = descr2tensor(descr_primer), + 1, nb_tokens, primer = descr2tensor(primer_descr), device = self.device ) return ' '.join([ self.id2token[t.item()] for t in results.flatten() ]) @@ -226,7 +226,7 @@ class TaskPicoCLVR(Task): result_descr = [ ] nb_per_primer = 8 - for descr_primer in [ + for primer_descr in [ 'red above green green top blue right of red ', 'there is red there is yellow there is blue ', 'red below yellow yellow below green green below blue red right yellow left green right blue left ', @@ -234,7 +234,7 @@ class TaskPicoCLVR(Task): ]: for k in range(nb_per_primer): - result_descr.append(self.generate(descr_primer, model, nb_tokens)) + result_descr.append(self.generate(primer_descr, model, nb_tokens)) img = [ picoclvr.descr2img(d, height = self.height, width = self.width) for d in result_descr ] -- 2.39.5