mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
initialize tiktoken environment at import time to support offline usage
This commit is contained in:
parent
45954155d7
commit
3f99a91a47
1 changed files with 4 additions and 0 deletions
|
|
@ -80,6 +80,10 @@ import dotenv
|
|||
litellm_mode = os.getenv("LITELLM_MODE", "DEV") # "PRODUCTION", "DEV"
|
||||
if litellm_mode == "DEV":
|
||||
dotenv.load_dotenv()
|
||||
|
||||
# Import default_encoding to ensure environment variables are initialized at import time
|
||||
from litellm.litellm_core_utils import default_encoding # noqa: F401
|
||||
|
||||
####################################################
|
||||
if set_verbose:
|
||||
_turn_on_debug()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue