Skip to content

Commit ed7887c

Browse files
authored
Merge pull request karpathy#270 from LaihoE/master
fix np.sum overflows on windows
2 parents 8020bb5 + 6649b29 commit ed7887c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

data/openwebtext/prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def process(example):
5050

5151
# concatenate all the ids in each dataset into one large file we can use for training
5252
for split, dset in tokenized.items():
53-
arr_len = np.sum(dset['len'])
53+
arr_len = np.sum(dset['len'], dtype=np.uint64)
5454
filename = os.path.join(os.path.dirname(__file__), f'{split}.bin')
5555
dtype = np.uint16 # (can do since enc.max_token_value == 50256 is < 2**16)
5656
arr = np.memmap(filename, dtype=dtype, mode='w+', shape=(arr_len,))

0 commit comments

Comments
 (0)