mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(utils.py): use local tiktoken copy
This commit is contained in:
parent
090bc361d8
commit
507b6bf96e
3 changed files with 100262 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue