mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-20 09:38:55 +02:00
fix for typical sampler
This commit is contained in:
@@ -2663,7 +2663,10 @@ void llama_v3_sample_typical(struct llama_v3_context * ctx, llama_v3_token_data_
|
||||
|
||||
float entropy = 0.0f;
|
||||
for (size_t i = 0; i < candidates->size; ++i) {
|
||||
entropy += -candidates->data[i].p * logf(candidates->data[i].p);
|
||||
if(candidates->data[i].p>0)
|
||||
{
|
||||
entropy += -candidates->data[i].p * logf(candidates->data[i].p);
|
||||
}
|
||||
}
|
||||
|
||||
// Compute the absolute difference between negative log probability and entropy for each candidate
|
||||
|
||||
Reference in New Issue
Block a user