From 36c7db8c44486cb543dcdc101dcc897ffede6be9 Mon Sep 17 00:00:00 2001 From: Christian Orr Date: Wed, 8 Mar 2023 10:16:19 +0200 Subject: [PATCH] bugfix in decode function Return was left out of the decoder, so it didn't work. --- data/shakespeare_char/prepare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/shakespeare_char/prepare.py b/data/shakespeare_char/prepare.py index c4f0306..9fd1621 100644 --- a/data/shakespeare_char/prepare.py +++ b/data/shakespeare_char/prepare.py @@ -32,7 +32,7 @@ itos = { i:ch for i,ch in enumerate(chars) } def encode(s): return [stoi[c] for c in s] # encoder: take a string, output a list of integers def decode(l): - ''.join([itos[i] for i in l]) # decoder: take a list of integers, output a string + return ''.join([itos[i] for i in l]) # decoder: take a list of integers, output a string # create the train and test splits n = len(data)