Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "ggml.h"

#include <cinttypes>
#include <float.h>
#include <fstream>
#include <random>
#include <map>
Expand Down Expand Up @@ -1757,6 +1758,12 @@ llama_token llama_sample_top_p_top_k(
// TODO: avoid this ...
const auto last_n_tokens = std::vector<llama_token>(last_n_tokens_data, last_n_tokens_data + last_n_tokens_size);

if (std::abs(temp) < FLT_EPSILON) {
temp = 0.8f;
top_k = 1.0f;
Comment thread
Fabio3rs marked this conversation as resolved.
Outdated
top_p = 0.0f;
}

result = llama_sample_top_p_top_k(
*ctx,
last_n_tokens,
Expand Down