diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2026-08-21 19:23:10 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2026-08-21 19:23:10 +0800 |
| commit | 3fba5649b1f8bd86c689ff8b4c6330c776220284 (patch) | |
| tree | 94bd26c67a96d6c1bde1049a3b9a7132a3826c82 | |
| parent | e2907df7bfc85869d814acfd213254fd0e95a9bc (diff) | |
| download | lex-3fba5649b1f8bd86c689ff8b4c6330c776220284.tar.gz | |
Bug fix: repeated prompt must not be ignored.
| -rw-r--r-- | llm.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -257,6 +257,14 @@ void llm_run(struct llm_ctx *llm, const char *user_prompt, FILE *out) syslog(LOG_WARNING, "cached prefix is shorter than the system prompt"); } + /* Force at least one real decode every request. If n_common hit + * n_new_tokens, decode gets skipped entirely, so ctx keeps the + * stale logits from the previous request's EOG -- sampling them + * again just reproduces EOG immediately (empty response on an + * exact repeat). */ + if (n_common == n_new_tokens) + n_common--; + /* Drop everything in the cache past the common prefix. */ llama_memory_seq_rm(llama_get_memory(llm->ctx), 0, /* sequence id: 0 - we only use one sequence */ |
