Compare commits

...

1 Commits

Author SHA1 Message Date
bobo
801c146348 Fix tiktoken_util.py to set TIKTOKEN_CACHE_DIR dynamically 2024-04-29 15:12:45 +08:00
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):
"""