nanoGPT icon indicating copy to clipboard operation
nanoGPT copied to clipboard

Improve readability of huge numbers

Open ryouze opened this issue 1 year ago • 0 comments

The readability of huge numbers can be improved by adding :,, which will insert a comma between every 3 numbers.

print(f"train has {len(train_ids)} tokens")
print(f"train has {len(train_ids):,} tokens")

Before:

  length of dataset in characters:  1115394
  train has 1003854 tokens
  val has 111540 tokens

After:

  length of dataset in characters: 1,115,394
  train has 1,003,854 tokens
  val has 111,540 tokens

ryouze avatar Jan 16 '23 21:01 ryouze