File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,13 @@ llama_token llama_sampling_sample(
167
167
llama_sample_grammar (ctx_main, &cur_p, ctx_sampling->grammar );
168
168
}
169
169
170
- if (temp <= 0 ) {
171
- // greedy sampling
170
+ if (temp < 0. 0 ) {
171
+ // greedy sampling, no probs
172
172
id = llama_sample_token_greedy (ctx_main, &cur_p);
173
+ } else if (temp == 0.0 ) {
174
+ // greedy sampling, with probs
175
+ llama_sample_softmax (ctx_main, &cur_p);
176
+ id = cur_p.data [0 ].id ;
173
177
} else {
174
178
if (mirostat == 1 ) {
175
179
const int mirostat_m = 100 ;
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ int main(int argc, char ** argv) {
118
118
std::vector<seq_draft> drafts (n_seq_dft);
119
119
120
120
params.sparams .grammar .clear (); // the draft samplers will copy the target sampler's grammar
121
- params.sparams .temp = std::max ( 0 . 01f , params. sparams . temp ) ;
121
+ params.sparams .temp = 0 . 0f ;
122
122
123
123
for (int s = 0 ; s < n_seq_dft; ++s) {
124
124
drafts[s].ctx_sampling = llama_sampling_init (params.sparams );
You can’t perform that action at this time.
0 commit comments