@@ -25,15 +25,15 @@ public sealed class DefaultSamplingPipeline
2525 /// Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text
2626 /// so far, decreasing the model's likelihood to repeat the same line verbatim.
2727 /// </summary>
28- public float AlphaFrequency
28+ public float FrequencyPenalty
2929 {
3030 get => _alphaFreq ;
3131 init
3232 {
3333 if ( value < - 2 )
34- throw new ArgumentOutOfRangeException ( nameof ( value ) , "AlphaFrequency must be greater than -2") ;
34+ throw new ArgumentOutOfRangeException ( nameof ( value ) , $ " { nameof ( FrequencyPenalty ) } must be greater than -2") ;
3535 if ( value > 2 )
36- throw new ArgumentOutOfRangeException ( nameof ( value ) , "AlphaFrequency must be less than 2") ;
36+ throw new ArgumentOutOfRangeException ( nameof ( value ) , $ " { nameof ( FrequencyPenalty ) } must be less than 2") ;
3737 _alphaFreq = value ;
3838 }
3939 }
@@ -44,15 +44,15 @@ public float AlphaFrequency
4444 /// Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the
4545 /// text so far, increasing the model's likelihood to talk about new topics.
4646 /// </summary>
47- public float AlphaPresence
47+ public float PresencePenalty
4848 {
4949 get => _alphaPresence ;
5050 init
5151 {
5252 if ( value < - 2 )
53- throw new ArgumentOutOfRangeException ( nameof ( value ) , "AlphaFrequency must be greater than -2") ;
53+ throw new ArgumentOutOfRangeException ( nameof ( value ) , $ " { nameof ( PresencePenalty ) } must be greater than -2") ;
5454 if ( value > 2 )
55- throw new ArgumentOutOfRangeException ( nameof ( value ) , "AlphaFrequency must be less than 2") ;
55+ throw new ArgumentOutOfRangeException ( nameof ( value ) , $ " { nameof ( PresencePenalty ) } must be less than 2") ;
5656 _alphaPresence = value ;
5757 }
5858 }
@@ -69,9 +69,9 @@ public float AlphaPresence
6969 public bool PenalizeNewline { get ; init ; } = false ;
7070
7171 /// <summary>
72- /// Whether the EOS token should be protected from being modified by penalty
72+ /// Whether the EOS token should be suppressed. Setting this to 'true' prevents EOS from being sampled
7373 /// </summary>
74- public bool PenalizeEOS { get ; init ; } = false ;
74+ public bool PreventEOS { get ; init ; } = false ;
7575
7676 /// <summary>
7777 /// Temperature to apply (higher temperature is more "creative")
@@ -147,8 +147,8 @@ protected override SafeLLamaSamplerChainHandle CreateChain(SafeLLamaContextHandl
147147 context . VocabCount ,
148148 context . ModelHandle . Tokens . EOS , context . ModelHandle . Tokens . Newline ?? 0 ,
149149 RepeatPenaltyCount , RepeatPenalty ,
150- AlphaFrequency , AlphaPresence ,
151- PenalizeNewline , PenalizeEOS
150+ FrequencyPenalty , PresencePenalty ,
151+ PenalizeNewline , PreventEOS
152152 ) ;
153153
154154 chain . AddTopK ( TopK ) ;
0 commit comments