Skip to content

Commit 3cb33a8

Browse files
committed
speculative : fix default RNG seed + set sparams.n_probs
1 parent 8241bc7 commit 3cb33a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/speculative/speculative.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ struct seq_draft {
3232
int main(int argc, char ** argv) {
3333
gpt_params params;
3434

35+
// needed to get candidate probs even for temp <= 0.0
36+
params.sparams.n_probs = 128;
37+
3538
if (!gpt_params_parse(argc, argv, params, LLAMA_EXAMPLE_SPECULATIVE)) {
3639
return 1;
3740
}
@@ -49,7 +52,7 @@ int main(int argc, char ** argv) {
4952
// probability threshold for splitting a draft branch (only for n_seq_dft > 1)
5053
const float p_split = params.p_split;
5154

52-
std::default_random_engine rng(params.sparams.seed);
55+
std::default_random_engine rng(params.sparams.seed == LLAMA_DEFAULT_SEED ? std::random_device()() : params.sparams.seed);
5356
std::uniform_real_distribution<> u_dist;
5457

5558
// init llama.cpp

0 commit comments

Comments
 (0)