| 169 | }; |
| 170 | |
| 171 | std::string common_params_sampling::print() const { |
| 172 | char result[1024]; |
| 173 | |
| 174 | snprintf(result, sizeof(result), |
| 175 | "\trepeat_last_n = %d, repeat_penalty = %.3f, frequency_penalty = %.3f, presence_penalty = %.3f\n" |
| 176 | "\tdry_multiplier = %.3f, dry_base = %.3f, dry_allowed_length = %d, dry_penalty_last_n = %d\n" |
| 177 | "\ttop_k = %d, top_p = %.3f, min_p = %.3f, xtc_probability = %.3f, xtc_threshold = %.3f, typical_p = %.3f, top_n_sigma = %.3f, temp = %.3f\n" |
| 178 | "\tmirostat = %d, mirostat_lr = %.3f, mirostat_ent = %.3f, adaptive_target = %.3f, adaptive_decay = %.3f", |
| 179 | penalty_last_n, penalty_repeat, penalty_freq, penalty_present, |
| 180 | dry_multiplier, dry_base, dry_allowed_length, dry_penalty_last_n, |
| 181 | top_k, top_p, min_p, xtc_probability, xtc_threshold, typ_p, top_n_sigma, temp, |
| 182 | mirostat, mirostat_eta, mirostat_tau, adaptive_target, adaptive_decay); |
| 183 | |
| 184 | return std::string(result); |
| 185 | } |
| 186 | |
| 187 | struct common_sampler * common_sampler_init(const struct llama_model * model, struct common_params_sampling & params) { |
| 188 | const llama_vocab * vocab = llama_model_get_vocab(model); |