Skip to content

Commit

Permalink
Merge pull request karpathy#270 from LaihoE/master
Browse files Browse the repository at this point in the history
fix np.sum overflows on windows
  • Loading branch information
karpathy authored Jun 14, 2023
2 parents 8020bb5 + 6649b29 commit ed7887c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/openwebtext/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def process(example):

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

0 comments on commit ed7887c

Please sign in to comment.