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

Add count_till_limit method on Tokenizer #35

Merged
merged 3 commits into from
Oct 22, 2024
Merged

Conversation

hendrikvanantwerpen
Copy link
Contributor

Adds a Tokenizer::count_till_limit method that accounts for input splitting.

@@ -86,6 +86,15 @@ impl Tokenizer {
.sum()
}

pub fn count_till_limit(&self, text: &str, token_limit: usize) -> Option<usize> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

some comment for the function?
It needs at least some explanation what the return value is...

Copy link
Collaborator

Choose a reason for hiding this comment

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

(maybe also comments for the other pub functions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c28e428

@hendrikvanantwerpen hendrikvanantwerpen merged commit df29b9c into main Oct 22, 2024
3 checks passed
@hendrikvanantwerpen hendrikvanantwerpen deleted the count-till-limit branch October 22, 2024 14:43
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