Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::SamplingConfig Class Referenceexport

Model-fixed configuration for TokenSampler. More...

Public Member Functions

float getFinalLogitSoftcap () const noexcept
int64_t getVocabularySize () const noexcept
void validate () const
 Validate configuration parameters.
template<typename Self>
decltype(auto) withFinalLogitSoftcap (this Self &&self, float softcap) noexcept
template<typename Self>
decltype(auto) withVocabularySize (this Self &&self, int64_t vocab_size) noexcept

Detailed Description

Model-fixed configuration for TokenSampler.

vocab_size is the logits width; final_logit_softcap is the Gemma-style c*tanh(logits/c) cap applied before temperature (0 disables it). Per-request sampling parameters live in GenerateParams (see TokenSampling.md section 4.1).

Member Function Documentation

◆ validate()

void Mila::Dnn::SamplingConfig::validate ( ) const
inline

Validate configuration parameters.

Throws std::invalid_argument on invalid configuration.


The documentation for this class was generated from the following file: