\brief Set the sampler \param sampler_config the sampler config \note The function will set the sampler \note The function will reset the sampler \note The function will set the sampler config
| 480 | /// \note The function will reset the sampler |
| 481 | /// \note The function will set the sampler config |
| 482 | void AutoModel::set_sampler(sampler_config& sampler_config) { |
| 483 | if (this->sampler != nullptr) { |
| 484 | this->sampler.reset(); |
| 485 | } |
| 486 | this->sampler = std::make_unique<Sampler>(this->lm_config->vocab_size, sampler_config); |
| 487 | } |
| 488 | |
| 489 | /// \brief Set the max length |
| 490 | /// \param MAX_L the max length |
no test coverage detected