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

Export vocab size and Code Llama usage docs #355

Merged
merged 2 commits into from
Aug 26, 2023

Conversation

janimo
Copy link
Contributor

@janimo janimo commented Aug 25, 2023

Code Llama and Code Llama Instruct models use 32016 tokens due to them being additionally finetuned on a fill in the middle task, unlike the Code Llama Python models.

That vocab size needs to be set at export otherwise these models output gibberish.
Some extra work is still needed since code models use RoPE theta of 1000000 instead of 10000 but they do emit code with the vocab_size change.

@atamurad
Copy link
Contributor

vocabulary size is missing in params.json but I think it should be copied from shape of tok_embeddings.weight.

I don't see a reason for the user to provide/override this from CLI option.

@janimo
Copy link
Contributor Author

janimo commented Aug 26, 2023

@atamurad you are right. I thought there may be cases where getting the embedding size is impractical, or there is some reason for having it as an extra field (as seen in HFmodels) but I guess in our case it makes sense. I have updated the PR. Thanks.

@karpathy karpathy merged commit e47bacd into karpathy:master Aug 26, 2023
6 checks passed
@janimo janimo deleted the export-vocab-size branch August 27, 2023 09:36
vinhtran2611 pushed a commit to vinhtran2611/llama2.c that referenced this pull request Jan 20, 2024
Export vocab size and Code Llama usage docs
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