-
Notifications
You must be signed in to change notification settings - Fork 44
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
Is there a way to only load the encoding needed? #23
Comments
Currently not, but I would be open to adding such a functionality Would adding a new |
Sure, that would be very appreciated! |
I am currently a little bit busy :) Could you open a PR with the change? If I am not mistaken it should be pretty straightforward, just extracting the common functionality of DefaultEncodingRegistry into an AbstractEncodingRegistry, renaming the DefaultEncodingRegistry to EagerEncodingRegistry, creating the LazyEncodingRegistry alongside it and exposing it via a new |
OK, I don't have the experience to contribute to open-source projects, but I'll give it a try. |
Thanks for the implementation 😊 This feature is released as part of 0.5.0 and should soon be available on maven central |
Hey there, thanks for your hard work. We're interested in using this library on mobile, but we noticed that the initialization process takes some time. We dug into the code and saw that
DefaultEncodingRegistry.initializeDefaultEncodings()
loads all the encodings. We only require ther50k_base.tiktoken
encoding, so is there a way to load just that one and speed up the initialization?The text was updated successfully, but these errors were encountered: