Always print num tokens
Also, add better context to --verbose-prompt output.
This commit is contained in:
parent
f3c3b4b167
commit
cfdc3494e3
1 changed files with 4 additions and 3 deletions
|
@ -273,10 +273,11 @@ int main(int argc, char ** argv) {
|
||||||
// determine newline token
|
// determine newline token
|
||||||
auto llama_token_newline = ::llama_tokenize(ctx, "\n", false);
|
auto llama_token_newline = ::llama_tokenize(ctx, "\n", false);
|
||||||
|
|
||||||
|
fprintf(stderr, "\n%s: number of tokens in prompt = %zu\n", __func__, embd_inp.size());
|
||||||
|
|
||||||
if (params.verbose_prompt) {
|
if (params.verbose_prompt) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "%s: full prompt: '%s'\n", __func__, params.prompt.c_str());
|
||||||
fprintf(stderr, "%s: prompt: '%s'\n", __func__, params.prompt.c_str());
|
fprintf(stderr, "%s: prompt tokens:\n", __func__);
|
||||||
fprintf(stderr, "%s: number of tokens in prompt = %zu\n", __func__, embd_inp.size());
|
|
||||||
for (int i = 0; i < (int) embd_inp.size(); i++) {
|
for (int i = 0; i < (int) embd_inp.size(); i++) {
|
||||||
fprintf(stderr, "%6d -> '%s'\n", embd_inp[i], llama_token_to_str(ctx, embd_inp[i]));
|
fprintf(stderr, "%6d -> '%s'\n", embd_inp[i], llama_token_to_str(ctx, embd_inp[i]));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue