- def generate(self, primer_descr, model, nb_tokens):
- results = autoregression(
- model, self.batch_size,
- 1, nb_tokens, primer = descr2tensor(primer_descr),
- device = self.device
- )
- return ' '.join([ self.id2token[t.item()] for t in results.flatten() ])
-
- def produce_results(self, n_epoch, model, nb_tokens = None):
- if nb_tokens is None:
- nb_tokens = self.height * self.width + 3
+ def produce_results(self, n_epoch, model):
+ nb_tokens = self.height * self.width + 3