Skip to content

Commit

Permalink
Fix RepititionPenalty from int to float (#7)
Browse files Browse the repository at this point in the history
* Fix `RepititionPenalty` from int to float

---------

Co-authored-by: Robby <h0rv@users.noreply.github.com>
  • Loading branch information
h0rv and h0rv authored Jan 28, 2024
1 parent 62936df commit 1aa4aaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/generate_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type GenerateOptions struct {
TopP *float64 `json:"top_p,omitempty"`
TopK *uint `json:"top_k,omitempty"`
RandomSeed *uint `json:"random_seed,omitempty"`
RepetitionPenalty *uint `json:"repetition_penalty,omitempty"`
RepetitionPenalty *float64 `json:"repetition_penalty,omitempty"`
MinNewTokens *uint `json:"min_new_tokens,omitempty"`
MaxNewTokens *uint `json:"max_new_tokens,omitempty"`
StopSequences *[]string `json:"stop_sequences,omitempty"`
Expand Down Expand Up @@ -73,7 +73,7 @@ func WithRandomSeed(randomSeed uint) GenerateOption {
}
}

func WithRepetitionPenalty(repetitionPenalty uint) GenerateOption {
func WithRepetitionPenalty(repetitionPenalty float64) GenerateOption {
return func(opts *GenerateOptions) {
opts.RepetitionPenalty = &repetitionPenalty
}
Expand Down

0 comments on commit 1aa4aaf

Please sign in to comment.