} else if (arg == "-n" || arg == "--n_predict") {
params.n_predict = std::stoi(argv[++i]);
} else if (arg == "--top_k") {
- params.top_k = std::stoi(argv[++i]);
+ params.top_k = std::max(1, std::stoi(argv[++i]));
} else if (arg == "--top_p") {
params.top_p = std::stof(argv[++i]);
} else if (arg == "--temp") {
params.n_predict = std::min(params.n_predict, model.hparams.n_ctx - (int) embd_inp.size());
printf("%s: prompt: '%s'\n", __func__, params.prompt.c_str());
- printf("%s: number of tokens in prompt = %zu, first 8 tokens: ", __func__, embd_inp.size());
- for (int i = 0; i < std::min(8, (int) embd_inp.size()); i++) {
- printf("%d ", embd_inp[i]);
+ printf("%s: number of tokens in prompt = %zu\n", __func__, embd_inp.size());
+ for (int i = 0; i < embd_inp.size(); i++) {
+ printf("%s: token[%d] = %6d, %s\n", __func__, i, embd_inp[i], vocab.id_to_token.at(embd_inp[i]).c_str());
}
printf("\n\n");