Skip to content

Commit c2a08f8

Browse files
anon998anon
andauthored
fix server sampling: top k sampler first (#1977)
Co-authored-by: anon <[email protected]>
1 parent 66a2555 commit c2a08f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ struct llama_server_context {
325325
id = llama_sample_token_mirostat_v2(ctx, &candidates_p, mirostat_tau, mirostat_eta, &mirostat_mu);
326326
} else {
327327
// Temperature sampling
328+
llama_sample_top_k(ctx, &candidates_p, top_k, 1);
328329
llama_sample_tail_free(ctx, &candidates_p, tfs_z, 1);
329330
llama_sample_typical(ctx, &candidates_p, typical_p, 1);
330331
llama_sample_top_p(ctx, &candidates_p, top_p, 1);
331-
llama_sample_top_k(ctx, &candidates_p, top_k, 1);
332332
llama_sample_temperature(ctx, &candidates_p, temp);
333333
id = llama_sample_token(ctx, &candidates_p);
334334
}

0 commit comments

Comments
 (0)