File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,20 @@ int main(int argc, char ** argv) {
277277 };
278278
279279 {
280- auto prompt = (params.conversation_mode && params.enable_chat_template )
280+ std::string prompt;
281+
282+ if (params.conversation_mode && params.enable_chat_template ) {
281283 // format the system prompt in conversation mode (will use template default if empty)
282- ? (params.system_prompt .empty () ? params.system_prompt : chat_add_and_format (" system" , params.system_prompt ))
284+ prompt = params.system_prompt ;
285+
286+ if (!prompt.empty ()) {
287+ prompt = chat_add_and_format (" system" , prompt);
288+ }
289+ } else {
283290 // otherwise use the prompt as is
284- : params.prompt ;
291+ prompt = params.prompt ;
292+ }
293+
285294 if (params.interactive_first || !params.prompt .empty () || session_tokens.empty ()) {
286295 LOG_DBG (" tokenize the prompt\n " );
287296 embd_inp = common_tokenize (ctx, prompt, true , true );
You can’t perform that action at this time.
0 commit comments