From: Florent BENOIT Date: Sun, 23 Feb 2025 17:15:51 +0000 (+0100) Subject: run: allow to customize prompt by env var LLAMA_PROMPT_PREFIX (#12041) X-Git-Tag: upstream/0.0.4853~89 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7ad0779f5de84a68143b2c00ab5dc94a948925d3;p=pkg%2Fggml%2Fsources%2Fllama.cpp run: allow to customize prompt by env var LLAMA_PROMPT_PREFIX (#12041) Signed-off-by: Florent Benoit --- diff --git a/examples/run/run.cpp b/examples/run/run.cpp index de736c7d..38407d51 100644 --- a/examples/run/run.cpp +++ b/examples/run/run.cpp @@ -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);