CK
← Back to C-Kernel-Engine Docs
Doxygen Source Documentation
Loading...
Searching...
No Matches
ck_sampler_v8.h
Go to the documentation of this file.
1
#ifndef CK_SAMPLER_V8_H
2
#define CK_SAMPLER_V8_H
3
4
#ifdef __cplusplus
5
extern
"C"
{
6
#endif
7
8
/*
9
* Sample one token from mutable logits.
10
*
11
* random_value must be in [0, 1). The function uses an allocation-free O(V)
12
* categorical path when top_p >= 1 and an exact O(V log V) nucleus path when
13
* 0 < top_p < 1. Non-positive temperature or top_p selects greedy argmax.
14
*/
15
int
ck_sample_top_p_v8
(
16
float
*logits,
17
int
vocab_size
,
18
float
temperature,
19
float
top_p,
20
float
random_value);
21
22
#ifdef __cplusplus
23
}
24
#endif
25
26
#endif
ck_sample_top_p_v8
int ck_sample_top_p_v8(float *logits, int vocab_size, float temperature, float top_p, float random_value)
vocab_size
int vocab_size
Definition
true_bpe.h:193
include
ck_sampler_v8.h
Generated by
1.9.8