Added a null token, which is the one to predict.
authorFrancois Fleuret <francois@fleuret.org>
Tue, 26 Jul 2022 11:27:58 +0000 (13:27 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Tue, 26 Jul 2022 11:27:58 +0000 (13:27 +0200)
main.py

diff --git a/main.py b/main.py
index 4a332b8..e973291 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -204,7 +204,7 @@ class TaskPicoCLVR(Task):
         t_generated = [ ]
 
         for j in range(nb_tokens):
-            t = [ [ self.token2id[u] for u in t_primer + t_generated ] ]
+            t = [ [ self.token2id[u] for u in t_primer + t_generated ] + [ 0 ] ]
             input = torch.tensor(t, device = self.device)
             output = model(input)
             logits = output[0, -1]