Skip to content

derive tokenizer type from model configuration #409

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
wants to merge 1 commit into from

Conversation

mikekgfb
Copy link
Contributor

derive tokenizer type from model configuration
introduce config_only option to load_model

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 23, 2024
):
if model is None:
) -> None:
if not (self.is_sentencepiece or self.tiktoken):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should self.tiktoken -> self.is_tiktoken? (from definition on line 143)

Copy link
Contributor Author

@mikekgfb mikekgfb Apr 23, 2024

Choose a reason for hiding this comment

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

Yeah but I’m not liking it anyway. I’ll try another way. This one just turns what we have into one horrible mess because it combines everything with everything. That being said, config _only is here to stay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if you’re going to get called with that, you can just return an empty model without loading anything other than configs.

can we get trustworthy information whether a model wants tiktoken or sentence from GGUF file?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we may be able to extract the name of the tokenizer model: https://github.com/ggerganov/ggml/blob/master/docs/gguf.md#tokenizer

@mikekgfb mikekgfb mentioned this pull request Apr 23, 2024
@mikekgfb
Copy link
Contributor Author

dead end for now because it makes the code too messy

@mikekgfb mikekgfb closed this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants