Skip to content

Commit 0cd8d26

Browse files
committed
run: allow to customize prompt by env var LLAMA_PROMPT_PREFIX
Signed-off-by: Florent Benoit <[email protected]>
1 parent f777a73 commit 0cd8d26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/run/run.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,11 @@ static int generate(LlamaData & llama_data, const std::string & prompt, std::str
976976
return 0;
977977
}
978978

979+
static const char * prompt_prefix_env = std::getenv("LLAMA_PROMPT_PREFIX");
980+
static const char * prompt_prefix = prompt_prefix_env ? prompt_prefix_env : "> ";
981+
979982
static int read_user_input(std::string & user_input) {
980-
static const char * prompt_prefix = "> ";
983+
981984
#ifdef WIN32
982985
printf("\r" LOG_CLR_TO_EOL LOG_COL_DEFAULT "%s", prompt_prefix);
983986

0 commit comments

Comments
 (0)