Skip to content

[Feature] Use local tokenizer #37

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

Closed
gespispace opened this issue Apr 20, 2024 · 0 comments · Fixed by #38
Closed

[Feature] Use local tokenizer #37

gespispace opened this issue Apr 20, 2024 · 0 comments · Fixed by #38
Assignees
Labels
enhancement New feature or request

Comments

@gespispace
Copy link
Member

FireCoder currently uses a tokenizer to determine the maximum length of the prompt for autocomplete. To achieve this, FireCoder sends the text to the llama.cpp tokenizer endpoint. However, this process takes time and cannot be used if the user is working on the cloud. It is important to provide as much context as possible, but the current method has some issues.

Firstly, to use the llama.cpp tokenizer, the user must download the server and model. However, this is not convenient for users who want to work with the cloud.
Secondly, preparing a prompt can take more than 2 seconds, which can be time-consuming.
Finally, FireCoder has a complex algorithm for selecting the maximum suitable length of the prompt with the minimum request to llama.cpp.

The solution is to use a local tokenizer that can be directly called from the extension. There are two possible options for this:

  1. Use tokenizers, but it works poorly when combined with nodejs bindings, so further investigation is needed.
  2. Use transformers.js, which should work well, but it still needs to be tested.
@gespispace gespispace added the enhancement New feature or request label Apr 20, 2024
@gespispace gespispace self-assigned this Apr 20, 2024
@gespispace gespispace linked a pull request Apr 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant