Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for python before 3.9 #14

Closed
wants to merge 1 commit into from
Closed

Conversation

avideci
Copy link

@avideci avideci commented Dec 21, 2022

Python 3.8.10
[GCC 9.4.0] on linux

>>> import tiktoken
>>> tiktoken
<module 'tiktoken' from 'venv/lib/python3.8/site-packages/tiktoken/__init__.py'>
>>> tiktoken.get_encoding('gpt2')
<Encoding 'gpt2'>

See discussion in #1

@@ -6,15 +6,16 @@

from tiktoken import _tiktoken

from typing import Dict, List, Tuple, Set, FrozenSet
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know which formatter you are using (black?)
I'll sort the imports and reformat the code as you wish.

@hauntsaninja
Copy link
Collaborator

Thanks for the PR! I just released tiktoken 0.1.2 that adds support for Python 3.8

Note that I'm not planning on adding support for 3.7, see #1
This PR doesn't work for 3.7 as we use some other 3.8 features (like cached_property and walrus)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants