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:
parent
f777a73e18
commit
7ad0779f5d
1 changed files with 2 additions and 1 deletions
|
@ -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 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
|
#ifdef WIN32
|
||||||
printf("\r" LOG_CLR_TO_EOL LOG_COL_DEFAULT "%s", prompt_prefix);
|
printf("\r" LOG_CLR_TO_EOL LOG_COL_DEFAULT "%s", prompt_prefix);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue