fix r random generation
This commit is contained in:
parent
e4896e71b5
commit
6b35c8b3cf
1 changed files with 5 additions and 7 deletions
|
@ -41,13 +41,11 @@ int main(int argc, char ** argv) {
|
||||||
// probability threshold for splitting a draft branch (only for n_seq_dft > 1)
|
// probability threshold for splitting a draft branch (only for n_seq_dft > 1)
|
||||||
const float p_split = params.p_split;
|
const float p_split = params.p_split;
|
||||||
|
|
||||||
std::mt19937 r_gen;
|
if (params.seed == LLAMA_DEFAULT_SEED) {
|
||||||
if (params.seed >= 0) {
|
params.seed = time(NULL);
|
||||||
r_gen = std::mt19937(params.seed);
|
|
||||||
} else {
|
|
||||||
r_gen = std::mt19937(time(NULL));
|
|
||||||
}
|
}
|
||||||
std::uniform_int_distribution<std::mt19937::result_type> u_dist(0, RAND_MAX);
|
std::default_random_engine rng(params.seed);
|
||||||
|
std::uniform_real_distribution<> u_dist;
|
||||||
|
|
||||||
#ifndef LOG_DISABLE_LOGS
|
#ifndef LOG_DISABLE_LOGS
|
||||||
log_set_target(log_filename_generator("speculative", "log"));
|
log_set_target(log_filename_generator("speculative", "log"));
|
||||||
|
@ -237,7 +235,7 @@ int main(int argc, char ** argv) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
float r = u_dist(r_gen) / (float) RAND_MAX;
|
float r = u_dist(rng);
|
||||||
llama_token_data_array dist_dft = drafts[s].dist[i_dft];
|
llama_token_data_array dist_dft = drafts[s].dist[i_dft];
|
||||||
// acquire the token probabilities assigned by the draft and target models
|
// acquire the token probabilities assigned by the draft and target models
|
||||||
for (int i = 0; i < dist_tgt.size; i++) {
|
for (int i = 0; i < dist_tgt.size; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue