run: allow to customize prompt by env var LLAMA_PROMPT_PREFIX (#12041)

Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
Florent BENOIT 2025-02-23 18:15:51 +01:00 committed by GitHub
parent f777a73e18
commit 7ad0779f5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -977,7 +977,8 @@ static int generate(LlamaData & llama_data, const std::string & prompt, std::str
}
static int read_user_input(std::string & user_input) {
static const char * prompt_prefix = "> ";
static const char * prompt_prefix_env = std::getenv("LLAMA_PROMPT_PREFIX");
static const char * prompt_prefix = prompt_prefix_env ? prompt_prefix_env : "> ";
#ifdef WIN32
printf("\r" LOG_CLR_TO_EOL LOG_COL_DEFAULT "%s", prompt_prefix);