Skip to content

Commit 9a390c4

Browse files
aumferngxson
andauthored
tools : fix uninitialized llama_batch in server (#13436)
* add constructor to initialize server_context::batch, preventing destructor's call to llama_batch_free from causing an invalid free() * Update tools/server/server.cpp Co-authored-by: Xuan-Son Nguyen <[email protected]> * use C++11 initializer syntax * switch from Copy-list-initialization to Direct-list-initialization --------- Co-authored-by: Xuan-Son Nguyen <[email protected]>
1 parent 0923237 commit 9a390c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/server/server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ struct server_context {
18621862

18631863
llama_context_params cparams_dft;
18641864

1865-
llama_batch batch;
1865+
llama_batch batch {};
18661866

18671867
bool clean_kv_cache = true;
18681868
bool add_bos_token = true;

0 commit comments

Comments
 (0)