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

Models without Vocabulary #5798

Merged
merged 10 commits into from
Mar 14, 2024
Merged

Conversation

Xarbirus
Copy link
Contributor

I made some changes to the model converter so that it could create a gguf model without a built-in dictionary.
This will allow to use any custom external dictionary in an application built with llama.cpp.

llama.h Outdated Show resolved Hide resolved
convert.py Outdated Show resolved Hide resolved
@cebtenzzre
Copy link
Collaborator

Do you have a more specific example of a use case for this feature - e.g., a model with a vocab type not currently supported by llama.cpp, but with weights that are?

Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

This seems something that can be useful

@Xarbirus
Copy link
Contributor Author

Xarbirus commented Mar 4, 2024

@cebtenzzre right now we're using some kind of this tokenizer with the llama model trained by our ml engineers. And in our system the vocab is on the client side, and the server only processes tokens. So there is no need for the vocab to be included in the model.

convert.py Outdated Show resolved Hide resolved
convert.py Outdated Show resolved Hide resolved
llama.h Outdated Show resolved Hide resolved
convert.py Outdated Show resolved Hide resolved
convert.py Outdated Show resolved Hide resolved
convert.py Outdated Show resolved Hide resolved
convert.py Show resolved Hide resolved
@ggerganov ggerganov merged commit 69ff613 into ggerganov:master Mar 14, 2024
54 of 62 checks passed
NeoZhangJianyu pushed a commit to NeoZhangJianyu/llama.cpp that referenced this pull request Mar 15, 2024
* additional methods to read model and ctx parameters

* vocab size as a part of a model metadata

* models without vocabulary, convert.py part

* models without vocabulary, llama.cpp part

* PR clean up

* converter scrypt fixes

* llama_vocab_type update (renamed the new key)

* pr review fixes

* revert function renaming

* one more NoVocab assert
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 1, 2024
* additional methods to read model and ctx parameters

* vocab size as a part of a model metadata

* models without vocabulary, convert.py part

* models without vocabulary, llama.cpp part

* PR clean up

* converter scrypt fixes

* llama_vocab_type update (renamed the new key)

* pr review fixes

* revert function renaming

* one more NoVocab assert
@Xarbirus Xarbirus deleted the models-without-vocab branch April 17, 2024 10:11
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.

3 participants