Skip to content

Commit 8a0b82a

Browse files
committed
examples : switch input_noecho to input_echo to remove negation
Signed-off-by: deadprogram <[email protected]>
1 parent c56b715 commit 8a0b82a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/main/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ int main(int argc, char ** argv) {
264264
bool is_stop_prompt = false;
265265
} antiprompt;
266266

267-
bool input_noecho = false;
267+
bool input_echo = true;
268268

269269
int n_past = 0;
270270
int n_remain = params.n_predict;
@@ -346,7 +346,7 @@ int main(int argc, char ** argv) {
346346
embd.push_back(id);
347347

348348
// echo this to console
349-
input_noecho = false;
349+
input_echo = true;
350350

351351
// decrement remaining sampling budget
352352
--n_remain;
@@ -364,14 +364,14 @@ int main(int argc, char ** argv) {
364364
}
365365

366366
// display text
367-
if (!input_noecho) {
367+
if (input_echo) {
368368
for (auto id : embd) {
369369
printf("%s", llama_token_to_str(ctx, id));
370370
}
371371
fflush(stdout);
372372
}
373373
// reset color to default if we there is no pending user input
374-
if (!input_noecho && (int)embd_inp.size() == n_consumed) {
374+
if (input_echo && (int)embd_inp.size() == n_consumed) {
375375
set_console_color(con_st, CONSOLE_COLOR_DEFAULT);
376376
}
377377

@@ -507,7 +507,7 @@ int main(int argc, char ** argv) {
507507
n_remain -= line_inp.size();
508508
}
509509

510-
input_noecho = true; // do not echo this again
510+
input_echo = false; // do not echo this again
511511
}
512512

513513
if (n_past > 0) {

0 commit comments

Comments
 (0)