mirror of
https://github.com/osmarks/nanogpt-experiments.git
synced 2024-11-10 20:09:58 +00:00
bugfix in decode function
Return was left out of the decoder, so it didn't work.
This commit is contained in:
parent
0d8fbd11ae
commit
36c7db8c44
@ -32,7 +32,7 @@ itos = { i:ch for i,ch in enumerate(chars) }
|
|||||||
def encode(s):
|
def encode(s):
|
||||||
return [stoi[c] for c in s] # encoder: take a string, output a list of integers
|
return [stoi[c] for c in s] # encoder: take a string, output a list of integers
|
||||||
def decode(l):
|
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
|
# create the train and test splits
|
||||||
n = len(data)
|
n = len(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user