Skip to content

Conversation

MollySophia
Copy link
Collaborator

Currently running llama-cli with --reverse-prompt option makes it crash in common_sampler_last() due to calling gsmpl->prev.rat(0) on an empty ring buffer, causing ring buffer: index out of bounds exception.

This fixes #14513 .

@MollySophia
Copy link
Collaborator Author

BTW I noticed that the --reverse-prompt option isn't enabled for LLAMA_EXAMPLE_SERVER. It's also not able to set in the webui. Is that an intended behavior? @ggerganov

@MollySophia MollySophia merged commit c82d48e into ggml-org:master Jul 21, 2025
47 checks passed
@ggerganov
Copy link
Member

I think we have "stop" strings that do the same in llama-server?

@MollySophia
Copy link
Collaborator Author

I think we have "stop" strings that do the same in llama-server?

Yeah I saw that it can be set in the completion api. I was wondering if the default value can be set on server startup.
After further reading, I found that the default value can be set with --props argument.
Thanks!

@MollySophia
Copy link
Collaborator Author

Hmmm nope, --props option enables properties modifying with API, rather than overrides certain properties' default values

@ggerganov
Copy link
Member

I guess we can enable LLAMA_EXAMPLE_SERVER for the reverse prompt and propagate it to the parameter parsing logic to use as a default:

{
params.antiprompt.clear();
const auto & stop = data.find("stop");
if (stop != data.end() && stop->is_array()) {
for (const auto & word : *stop) {
if (!word.empty()) {
params.antiprompt.push_back(word);
}
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eval bug: "zsh: IOT instruction (core dumped)" in RWKV when use reverse prompt without --prompt or -p option

2 participants