openai / tiktoken

tiktoken is a fast BPE tokeniser for use with OpenAI's models.
MIT License
11.61k stars 784 forks source link

Unknown encoding cl100k_base when building program using pyinstaller #163

Closed Klyser8 closed 1 year ago

Klyser8 commented 1 year ago

Traceback (most recent call last): File "voicemain.py", line 16, in <module> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module File "chatsession.py", line 8, in <module> File "chatsession.py", line 12, in ChatSession File "tiktoken\registry.py", line 60, in get_encoding ValueError: Unknown encoding cl100k_base [8404] Failed to execute script 'voicemain' due to unhandled exception!

My program works fine when running it from my IDE (PyCharm), though when I try building it with pyinstaller and running the resulting exe file, I get that strange error about the encoding not existing.

Is this an issue with tiktoken?

hauntsaninja commented 1 year ago

See the FAQ