Skip to content

Commit 8af372b

Browse files
authored
small readability change and fix (long) outdated example usage
1 parent 771fae0 commit 8af372b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/main/main.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ static void print_usage(int argc, char ** argv) {
4545
(void) argc;
4646

4747
LOG("\nexample usage:\n");
48-
LOG("\n text generation: %s -m your_model.gguf -p \"I believe the meaning of life is\" -n 128\n", argv[0]);
49-
LOG("\n chat (conversation): %s -m your_model.gguf -p \"You are a helpful assistant\" -cnv\n", argv[0]);
48+
LOG("\n text generation: %s -m your_model.gguf -p \"I believe the meaning of life is\" -n 128 -no-cnv\n", argv[0]);
49+
LOG("\n chat (conversation): %s -m your_model.gguf -sys \"You are a helpful assistant\"\n", argv[0]);
5050
LOG("\n");
5151
}
5252

@@ -279,11 +279,9 @@ int main(int argc, char ** argv) {
279279
std::string prompt;
280280
{
281281
if (params.conversation_mode && params.enable_chat_template) {
282-
prompt = params.system_prompt;
283-
284-
if (!prompt.empty()) {
282+
if (!params.system_prompt.empty()) {
285283
// format the system prompt (will use template default if empty)
286-
chat_add_and_format("system", prompt);
284+
chat_add_and_format("system", params.system_prompt);
287285
}
288286

289287
if (!params.prompt.empty()) {
@@ -293,7 +291,7 @@ int main(int argc, char ** argv) {
293291
waiting_for_first_input = true;
294292
}
295293

296-
if (!prompt.empty() || !params.prompt.empty()) {
294+
if (!params.system_prompt.empty() || !params.prompt.empty()) {
297295
common_chat_templates_inputs inputs;
298296
inputs.messages = chat_msgs;
299297
inputs.add_generation_prompt = !params.prompt.empty();

0 commit comments

Comments
 (0)