summaryrefslogtreecommitdiff
path: root/examples/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/main/main.cpp')
-rw-r--r--examples/main/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 4665b82f..11d7a7e4 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -604,7 +604,12 @@ int main(int argc, char ** argv) {
last_n_tokens.data() + last_n_tokens.size() - last_n_repeat,
last_n_repeat, alpha_frequency, alpha_presence);
if (!penalize_nl) {
- logits[llama_token_nl(ctx)] = nl_logit;
+ for (size_t idx = 0; idx < candidates_p.size; idx++) {
+ if (candidates_p.data[idx].id == llama_token_nl(ctx)) {
+ candidates_p.data[idx].logit = nl_logit;
+ break;
+ }
+ }
}
if (grammar != NULL) {