Skip to content

Conversation

ochafik
Copy link
Collaborator

@ochafik ochafik commented Oct 30, 2024

Proposing to restore the plain, stdout behaviour of llama-cli.

Introduced a mini test that checks that llama-cli -p hello --log-disable / llama-cli -p hello 2>/dev/null outputs just the (prompt and) completion text.

(currently --log-disable disables... everything)

@github-actions github-actions bot added testing Everything test related examples ggml changes relating to the ggml tensor library for machine learning labels Oct 30, 2024
Comment on lines 66 to 68
auto p = run(cli_bin + " -hfr ggml-org/models -hff tinyllamas/stories260K.gguf --prompt hello --seed 42 -ngl 0 -n 10");
assert_equals(" hello Joe and Joe we", p.out);
assert_contains("system_info:", p.err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default sampling settings can change in the future, using greedy sampling here may be more reliable.

Comment on lines 719 to +721
// Console/Stream Output
LOG("%s", token_str.c_str());
fprintf(stdout, "%s", token_str.c_str());
fflush(stdout);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixing printf and common/log is not recommended because they run on 2 different threads and the output can get out of order. Maybe try using LOGV(-1, ...); and then instead of --log-disable use --log-verbosity -1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples ggml changes relating to the ggml tensor library for machine learning testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants