Initializes and configures the sampler
| 901 | |
| 902 | // Initializes and configures the sampler |
| 903 | llama_sampler_ptr initialize_sampler(const Opt & opt) { |
| 904 | llama_sampler_ptr sampler(llama_sampler_chain_init(llama_sampler_chain_default_params())); |
| 905 | llama_sampler_chain_add(sampler.get(), llama_sampler_init_min_p(0.05f, 1)); |
| 906 | llama_sampler_chain_add(sampler.get(), llama_sampler_init_temp(opt.temperature)); |
| 907 | llama_sampler_chain_add(sampler.get(), llama_sampler_init_dist(LLAMA_DEFAULT_SEED)); |
| 908 | |
| 909 | return sampler; |
| 910 | } |
| 911 | }; |
| 912 | |
| 913 | // Add a message to `messages` and store its content in `msg_strs` |
nothing calls this directly
no test coverage detected