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

LLamaToken Struct #404

Merged

Conversation

martindevans
Copy link
Member

This is a major change to the API. All uses of int (or llama_token, aliasing int) to represent a token have been replaced with a LLamaToken struct. This makes the API more strongly typed - it's less likely to mix up a token with some other non-token integer.

In general fixing any breakage is easy, you can just cast (int)the_token or (LLamaToken)1. Not many places in the basic API deal in raw tokens, and usually work on strings instead, so I'm actually not expecting this to seriously affect many users.

@martindevans
Copy link
Member Author

I'd like to get this one reviewed soon if possible, it touches a lot of files and so it will rapidly become a pain to merge if other PRs are merged.

@saddam213
Copy link
Collaborator

Sorry didn't see this request,

changes look fine to me :) however I don't know the lower levels that well

@martindevans martindevans merged commit 402a110 into SciSharp:master Jan 9, 2024
3 checks passed
@martindevans martindevans deleted the switched_to_LLamaToken_struct branch January 9, 2024 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants