Skip to content

Distribute and run LLMs with a single file.

Fix typical sampling (#4261)

tarcey90fa20f5c178
diff --git a/llama.cpp/llama.cpp b/llama.cpp/llama.cpp
index 562cc751..eb09eb2d 100644
--- a/llama.cpp/llama.cpp
+++ b/llama.cpp/llama.cpp
@@ -6754,6 +6754,7 @@ void llama_sample_typical(struct llama_context * ctx, llama_token_data_array * c
// Replace the data in candidates with the new_candidates data
std::copy(new_candidates.begin(), new_candidates.end(), candidates->data);
candidates->size = new_candidates.size();
+ candidates->sorted = false;
if (ctx) {
ctx->t_sample_us += ggml_time_us() - t_start_sample_us;