relocate previous newline token const

This commit is contained in:
rabidcopy 2023-03-20 14:35:36 -05:00 committed by GitHub
parent 3eca29ec0d
commit 94edeaf7df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,9 +176,6 @@ bool llama_model_load(const std::string & fname, llama_model & model, gpt_vocab
vocab.id_to_token[i] = word;
vocab.score[i] = score;
// dynamically determine the newline token
const auto NEWLINE_TOKEN_ID = vocab.token_to_id["\n"];
//if (i < 30000) {
// fprintf(stderr, "%s: vocab[%d] = '%s'\n", __func__, i, word.c_str());
//}
@ -953,6 +950,9 @@ int main(int argc, char ** argv) {
int remaining_tokens = params.n_predict;
// dynamically determine the newline token
const auto NEWLINE_TOKEN_ID = vocab.token_to_id["\n"];
// set the color for the prompt which will be output initially
if (params.use_color) {
printf(ANSI_COLOR_YELLOW);