mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-17 08:18:09 +00:00
fix(utils.py): use local tiktoken copy
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@ def test_token_counter_normal_plus_function_calling():
|
||||
pytest.fail(f"An exception occurred - {str(e)}")
|
||||
|
||||
|
||||
test_token_counter_normal_plus_function_calling()
|
||||
# test_token_counter_normal_plus_function_calling()
|
||||
|
||||
|
||||
def test_tokenizers():
|
||||
|
||||
@@ -27,7 +27,12 @@ from dataclasses import (
|
||||
dataclass,
|
||||
field,
|
||||
) # for storing API inputs, outputs, and metadata
|
||||
import pkg_resources
|
||||
|
||||
filename = pkg_resources.resource_filename(__name__, "llms/tokenizers")
|
||||
os.environ[
|
||||
"TIKTOKEN_CACHE_DIR"
|
||||
] = filename # use local copy of tiktoken b/c of - https://github.com/BerriAI/litellm/issues/1071
|
||||
encoding = tiktoken.get_encoding("cl100k_base")
|
||||
import importlib.metadata
|
||||
from .integrations.traceloop import TraceloopLogger
|
||||
|
||||
Reference in New Issue
Block a user