Feat: Add tokens counter

Open
#41 0 comments 0 reactions 1 assignee View on GitHub

@Angelchev is already working on this.

Since Jan 3, 2024.

  • #47 by @Angelchev — open

Assessment

This issue has not been assessed yet.

Description

enhancement

Overview

It would be useful to add the ability for neural to get the token count for some given input. This would help prevent initiating requests that accidentally go over the maximum token count for some given model source.

This will also be useful in situations where we want to extract the maximum possible response from a model via request_token_num = model_max_token_len - context_tokens_len

Implementation

  • The tokenizer should be appropriate for the respective model
  • We should use an open-source (Ideally MIT) tokenizer that we can bundle to not require installing additional dependencies
Dominant language
Vim Script
Stars
506
Forks
19
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dense-analysis/neural

All issues in dense-analysis/neural

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.