Skip to content

Commit

Permalink
Add missing change...
Browse files Browse the repository at this point in the history
  • Loading branch information
goerch committed Sep 14, 2023
1 parent 01b0105 commit c7c0fcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/train-text-from-scratch/train-text-from-scratch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,10 @@ int tokenize_file(struct llama_context * lctx, const char * filename, std::vecto

buf[size] = '\0';

int n_tokens = llama_tokenize(lctx, buf.data(), out.data(), out.size(), false);
int n_tokens = llama_tokenize(lctx, buf.data(), buf.size(), out.data(), out.size(), false);
if (n_tokens < 0) {
out.resize(-n_tokens);
n_tokens = llama_tokenize(lctx, buf.data(), out.data(), out.size(), false);
n_tokens = llama_tokenize(lctx, buf.data(), buf.size(), out.data(), out.size(), false);
}
GGML_ASSERT(n_tokens >= 0);
out.resize(n_tokens);
Expand Down

0 comments on commit c7c0fcb

Please sign in to comment.