Skip to content

Commit 814a09d

Browse files
author
Lőrinc
committed
Add tests for humongous encodings
1 parent 1b9faf2 commit 814a09d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_encoding.py

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
from .test_helpers import ENCODING_FACTORIES, MAX_EXAMPLES
1212

1313

14+
def test_extremely_big_encoding():
15+
big_value = "^" * 1000000
16+
enc = tiktoken.get_encoding("r50k_base")
17+
assert big_value == enc.decode(enc.encode(big_value))
18+
19+
1420
def test_simple():
1521
enc = tiktoken.get_encoding("gpt2")
1622
assert enc.encode("hello world") == [31373, 995]

0 commit comments

Comments
 (0)