Skip to content

Commit 7ad0779

Browse files
authored
run: allow to customize prompt by env var LLAMA_PROMPT_PREFIX (#12041)
Signed-off-by: Florent Benoit <[email protected]>
1 parent f777a73 commit 7ad0779

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/run/run.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,8 @@ static int generate(LlamaData & llama_data, const std::string & prompt, std::str
977977
}
978978

979979
static int read_user_input(std::string & user_input) {
980-
static const char * prompt_prefix = "> ";
980+
static const char * prompt_prefix_env = std::getenv("LLAMA_PROMPT_PREFIX");
981+
static const char * prompt_prefix = prompt_prefix_env ? prompt_prefix_env : "> ";
981982
#ifdef WIN32
982983
printf("\r" LOG_CLR_TO_EOL LOG_COL_DEFAULT "%s", prompt_prefix);
983984

0 commit comments

Comments
 (0)