| 131 | }; |
| 132 | |
| 133 | std::string common_params_sampling::print() const { |
| 134 | char result[1024]; |
| 135 | |
| 136 | snprintf(result, sizeof(result), |
| 137 | "\trepeat_last_n = %d, repeat_penalty = %.3f, frequency_penalty = %.3f, presence_penalty = %.3f\n" |
| 138 | "\tdry_multiplier = %.3f, dry_base = %.3f, dry_allowed_length = %d, dry_penalty_last_n = %d\n" |
| 139 | "\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" |
| 140 | "\tmirostat = %d, mirostat_lr = %.3f, mirostat_ent = %.3f", |
| 141 | penalty_last_n, penalty_repeat, penalty_freq, penalty_present, |
| 142 | dry_multiplier, dry_base, dry_allowed_length, dry_penalty_last_n, |
| 143 | top_k, top_p, min_p, xtc_probability, xtc_threshold, typ_p, top_n_sigma, temp, |
| 144 | mirostat, mirostat_eta, mirostat_tau); |
| 145 | |
| 146 | return std::string(result); |
| 147 | } |
| 148 | |
| 149 | struct common_sampler * common_sampler_init(const struct llama_model * model, const struct common_params_sampling & params) { |
| 150 | const llama_vocab * vocab = llama_model_get_vocab(model); |