Fix tiktoken_util.py to set TIKTOKEN_CACHE_DIR dynamically

This commit is contained in:
bobo 2024-04-29 11:06:30 +08:00 committed by kagami
parent daea79e719
commit 801c146348
2 changed files with 100259 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,8 @@
import os
import tiktoken
script_dir = os.path.dirname(os.path.realpath(__file__))
os.environ['TIKTOKEN_CACHE_DIR'] = os.path.join(script_dir, 'tiktoken_cache')
def get_encoding(encoding_name: str):
"""