From 9c7dbb9ca70858b870f74ecf595d3169f0cbc711 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 27 Sep 2022 23:11:06 +0200 Subject: Rename mapping to tokenizer --- training/callbacks/wandb_callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'training/callbacks') diff --git a/training/callbacks/wandb_callbacks.py b/training/callbacks/wandb_callbacks.py index dc59f19..7d4f48e 100644 --- a/training/callbacks/wandb_callbacks.py +++ b/training/callbacks/wandb_callbacks.py @@ -117,9 +117,9 @@ class LogTextPredictions(Callback): imgs = imgs.to(device=pl_module.device) logits = pl_module.predict(imgs) - mapping = pl_module.mapping + tokenizer = pl_module.tokenizer data = [ - wandb.Image(img, caption=mapping.get_text(pred)) + wandb.Image(img, caption=tokenizer.decode(pred)) for img, pred, label in zip( imgs[: self.num_samples], logits[: self.num_samples], -- cgit v1.2.3-70-g09d2