mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-06-27 23:50:20 -05:00
use destructor instead
This commit is contained in:
parent
5d67f69f59
commit
a432e6f863
@ -35,6 +35,9 @@ struct cli_context {
|
||||
bool has_video = false;
|
||||
|
||||
cli_context(const common_params & params) : params(params) {}
|
||||
~cli_context() {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
// connect to --server-base or spawn a local llama-server child;
|
||||
// argc/argv are needed to forward the server-relevant args to the child
|
||||
|
||||
@ -59,13 +59,8 @@ int llama_cli(int argc, char ** argv) {
|
||||
cli_context ctx_cli(params);
|
||||
|
||||
if (!ctx_cli.init()) {
|
||||
ctx_cli.shutdown();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ret = ctx_cli.run();
|
||||
|
||||
ctx_cli.shutdown();
|
||||
|
||||
return ret;
|
||||
return ctx_cli.run();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user