Skip to content

Commit

Permalink
Merge pull request #195 from clebert/prompt-tokens-size
Browse files Browse the repository at this point in the history
Adjust `malloc` size for `prompt_tokens`
  • Loading branch information
karpathy authored Aug 5, 2023
2 parents bdf3a6c + 2c0134f commit a2962b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ int main(int argc, char *argv[]) {
int *prompt_tokens = NULL;
int num_prompt_tokens = 0;
if (prompt != NULL) {
prompt_tokens = (int*)malloc(config.seq_len * sizeof(int));
prompt_tokens = (int*)malloc(strlen(prompt) * sizeof(int));
bpe_encode(prompt, vocab, vocab_scores, config.vocab_size, max_token_length, prompt_tokens, &num_prompt_tokens);
}

Expand Down

0 comments on commit a2962b9

Please sign in to comment.