mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Merge pull request #1947 from sorokine/main
Update utils.py: switched from pkg_resources to importlib.resources for `filename` stored in the `os.environ(TIKTOKEN_CACHE_DIR)`
This commit is contained in:
commit
78bff46d4a
1 changed files with 4 additions and 2 deletions
|
@ -29,9 +29,11 @@ from dataclasses import (
|
|||
dataclass,
|
||||
field,
|
||||
) # for storing API inputs, outputs, and metadata
|
||||
import pkg_resources
|
||||
#import pkg_resources
|
||||
from importlib import resources
|
||||
|
||||
filename = pkg_resources.resource_filename(__name__, "llms/tokenizers")
|
||||
# filename = pkg_resources.resource_filename(__name__, "llms/tokenizers")
|
||||
filename = str(resources.files().joinpath("llms/tokenizers"))
|
||||
os.environ[
|
||||
"TIKTOKEN_CACHE_DIR"
|
||||
] = filename # use local copy of tiktoken b/c of - https://github.com/BerriAI/litellm/issues/1071
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue