-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: add tiktoken fallback mechanism. #3929
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @danielbichuetti, thank you for this fix! We realized just yesterday night that tiktoken
broke a few Docker builds 🙈 Hopefully this will fix it.
Linking this to the open issue on the tiktoken library for visibility openai/tiktoken#23 |
Just out of curiosity, would the workaround in this comment work for us as well? (Basically building the wheels from scratch). This way we could keep the tiktoken library in our docker images as well, but I'm not sure of the cons of this approach. |
Yesterday with @silvanocerza we tried to apply it with no success. We could try harder, but I don't see the benefit right now. I think makes sense to disable the unsupported platforms for this release, and reconsider it later. Maybe there are going to be prebuilt wheels by then! I will take care of adding a "self-destructing" reminder test in Haystack once CI has been moved to 3.8, so that we don't forget. |
* feat: migrate to tiktoken when tokenizing for OpenAI * refactor: add OpenAI optional egg * fix: add Python 3.7 fallback support for tiktoken * refactor: change both tokenization implementations and fix mypy * refactor: remove dummy-class * refactor: add tiktoken as core dependency and minor refactoring * refactor: sort imports * refactor: remove out-of-scope PR change * refactor: reintroduce corner case check * refactor: remove unused egg * refactor: remove unused exception after titkoken as core dep * refactor: reduce ifs and include log warning * refactor: remove timeout linting ignore * refactor: revert change due to mypy * refactor: disable pylint import error * fix: add arm64 fallback to HF tokenizer * fix: add aarch64 fallback mechanism * refactor: improve log message * fix: change platform selection method * refactor: consolidate archs
Related Issues
tiktoken
#3927Proposed Changes:
Implemented fallback to HF FastTokenizer in Linux ARM64 and AARCH64
How did you test it?
Ubuntu 22.04, Windows, Mac M1
Notes for the reviewer
tiktoken wheels available in PiPy:
https://pypi.org/pypi/tiktoken/json
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.