test-cli
: greedy sampling + print exception messages
This commit is contained in:
parent
030fda09a9
commit
82d5e91a6f
1 changed files with 21 additions and 16 deletions
|
@ -53,6 +53,7 @@ static Out run(const std::string & cmd) {
|
|||
int main(int argc, char ** argv) {
|
||||
std::string cli_bin = argc == 2 ? argv[1] : "./llama-cli";
|
||||
|
||||
try {
|
||||
std::system("mkdir out/");
|
||||
|
||||
{
|
||||
|
@ -63,14 +64,18 @@ int main(int argc, char ** argv) {
|
|||
}
|
||||
|
||||
{
|
||||
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);
|
||||
auto p = run(cli_bin + " -hfr ggml-org/models -hff tinyllamas/stories260K.gguf --prompt hello --seed 42 --samplers top-k --top-k 1 -ngl 0 -n 10");
|
||||
assert_equals(" hello was a big, red ball. He", p.out);
|
||||
assert_contains("system_info:", p.err);
|
||||
}
|
||||
|
||||
{
|
||||
auto p = run(cli_bin + " -hfr ggml-org/models -hff tinyllamas/stories260K.gguf --prompt hello --seed 42 -ngl 0 -n 10 --log-disable");
|
||||
assert_equals(" hello Joe and Joe we", p.out);
|
||||
auto p = run(cli_bin + " -hfr ggml-org/models -hff tinyllamas/stories260K.gguf --prompt hello --seed 42 --samplers top-k --top-k 1 -ngl 0 -n 10 --log-disable");
|
||||
assert_equals(" hello was a big, red ball. He", p.out);
|
||||
assert_equals("", p.err);
|
||||
}
|
||||
} catch (const std::exception & ex) {
|
||||
std::cerr << "[test-cli] Error: " << ex.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue