openai/tiktoken

Public

mirrored fromhttps://github.com/openai/tiktokenAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
main

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

tests/test_helpers.py

22lines · modecode

1import bisect
2import functools
3import os
4
5import pytest
6
7import tiktoken
8
9MAX_EXAMPLES: int = int(os.environ.get("TIKTOKEN_MAX_EXAMPLES", "100"))
10
11ENCODINGS = ["r50k_base", "cl100k_base"]
12SOME_ENCODINGS = ["cl100k_base"]
13
14
15ENCODING_FACTORIES = [
16 pytest.param(functools.partial(tiktoken.get_encoding, name), id=name) for name in ENCODINGS
17]
18SOME_ENCODING_FACTORIES = [
19 pytest.param(functools.partial(tiktoken.get_encoding, name), id=name) for name in SOME_ENCODINGS
20]