Skip to content

Commit ade68d0

Browse files
committed
Merge remote-tracking branch 'upstream/concedo'
2 parents 521ad6b + 56995ca commit ade68d0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gpttype_adapter.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ llama_token sample_token_mirostat_v2(llama_token_data_array * candidates, std::m
178178
candidates->size = std::distance(candidates->data, std::find_if(candidates->data, candidates->data + candidates->size, [&](const llama_token_data & candidate) {
179179
return -log2f(candidate.p) > *mu;
180180
}));
181+
182+
if (candidates->size == 0) {
183+
candidates->size = 1;
184+
}
185+
181186
// Normalize the probabilities of the remaining words
182187
llama_sample_softmax(nullptr, candidates);
183188
// Sample the next word X from the remaining words

0 commit comments

Comments
 (0)