mirror of
https://github.com/ollama/ollama.git
synced 2026-03-27 02:58:43 +07:00
sample: fix lint issues in penalty sampler
This commit is contained in:
@@ -68,7 +68,7 @@ func (s Sampler) PenalizesHistory() bool {
|
||||
}
|
||||
|
||||
func (s *Sampler) applyHistoryPenalties(tokens []token) {
|
||||
if s.counts == nil || len(s.counts) == 0 {
|
||||
if len(s.counts) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ func TestSamplerNoopPenaltiesSkipHistory(t *testing.T) {
|
||||
t.Fatal("expected no-op penalties to disable history tracking")
|
||||
}
|
||||
|
||||
for i := 0; i < DefaultPenaltyLookback+10; i++ {
|
||||
for range DefaultPenaltyLookback + 10 {
|
||||
sampler.Accept(1)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func TestSamplerActivePenaltiesTrackLookback(t *testing.T) {
|
||||
t.Fatal("expected non-default penalties to enable history tracking")
|
||||
}
|
||||
|
||||
for i := 0; i < DefaultPenaltyLookback+10; i++ {
|
||||
for range DefaultPenaltyLookback + 10 {
|
||||
sampler.Accept(7)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user