forked from phoenix/litellm-mirror
Merge pull request #2017 from sorokine/main
This commit is contained in:
commit
9ce29295af
1 changed files with 9 additions and 8 deletions
|
@ -31,16 +31,17 @@ from dataclasses import (
|
||||||
field,
|
field,
|
||||||
) # for storing API inputs, outputs, and metadata
|
) # for storing API inputs, outputs, and metadata
|
||||||
|
|
||||||
# import pkg_resources
|
|
||||||
from importlib import resources
|
|
||||||
|
|
||||||
# filename = pkg_resources.resource_filename(__name__, "llms/tokenizers")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
filename = str(
|
# this works in python 3.8
|
||||||
resources.files().joinpath("llms/tokenizers") # type: ignore
|
import pkg_resources
|
||||||
) # for python 3.8 and 3.12
|
filename = pkg_resources.resource_filename(__name__, "llms/tokenizers")
|
||||||
|
# try:
|
||||||
|
# filename = str(
|
||||||
|
# resources.files().joinpath("llms/tokenizers") # type: ignore
|
||||||
|
# ) # for python 3.8 and 3.12
|
||||||
except:
|
except:
|
||||||
|
# this works in python 3.9+
|
||||||
|
from importlib import resources
|
||||||
filename = str(
|
filename = str(
|
||||||
resources.files(litellm).joinpath("llms/tokenizers") # for python 3.10
|
resources.files(litellm).joinpath("llms/tokenizers") # for python 3.10
|
||||||
) # for python 3.10+
|
) # for python 3.10+
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue