MCPcopy Index your code
hub / github.com/openai/tiktoken / test_basic_encode

Function test_basic_encode

tests/test_encoding.py:69–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67
68
69def test_basic_encode():
70 enc = tiktoken.get_encoding("r50k_base")
71 assert enc.encode("hello world") == [31373, 995]
72
73 enc = tiktoken.get_encoding("p50k_base")
74 assert enc.encode("hello world") == [31373, 995]
75
76 enc = tiktoken.get_encoding("cl100k_base")
77 assert enc.encode("hello world") == [15339, 1917]
78 assert enc.encode(" \x850") == [220, 126, 227, 15]
79
80
81def test_encode_empty():

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…