Skip to content

Commit

Permalink
Add tests for humongous encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lőrinc committed Feb 11, 2024
1 parent 1b9faf2 commit 814a09d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
from .test_helpers import ENCODING_FACTORIES, MAX_EXAMPLES


def test_extremely_big_encoding():
big_value = "^" * 1000000
enc = tiktoken.get_encoding("r50k_base")
assert big_value == enc.decode(enc.encode(big_value))


def test_simple():
enc = tiktoken.get_encoding("gpt2")
assert enc.encode("hello world") == [31373, 995]
Expand Down

0 comments on commit 814a09d

Please sign in to comment.