Update common/sampling.cpp

Co-authored-by: compilade <git@compilade.net>
This commit is contained in:
Justine Tunney 2024-05-21 16:20:38 -07:00 committed by GitHub
parent 6b178988f5
commit aa3094c91d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,9 +195,7 @@ static llama_token llama_sampling_sample_impl(
llama_token id = 0;
// Get a pointer to the logits
float * logits = llama_get_logits_ith(ctx_main, idx);
if (!logits) {
throw std::runtime_error("llama_get_logits_ith failed");
}
GGML_ASSERT(logits); // already checked in llama_sampling_prepare
if (temp < 0.0) {
// greedy sampling, with probs