Skip to content

Commit

Permalink
Merge pull request #41 from marclop/f/add-NumCtx-option
Browse files Browse the repository at this point in the history
api: add `NumCtx` option
  • Loading branch information
k33g authored Dec 21, 2024
2 parents ea5fe9d + e7d9aa5 commit c4d41d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions enums/option/option.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package option
package option

const (
RepeatLastN = "RepeatLastN"
RepeatLastN = "RepeatLastN"
Temperature = "Temperature"
Seed = "Seed"
RepeatPenalty = "RepeatPenalty"
Stop = "Stop"

NumKeep = "NumKeep"
NumPredict = "NumPredict"
NumCtx = "NumCtx"
TopK = "TopK"
TopP = "TopP"
TFSZ = "TFSZ"
Expand All @@ -21,4 +22,4 @@ const (
PenalizeNewline = "PenalizeNewline"

Verbose = "Verbose"
)
)
4 changes: 4 additions & 0 deletions llm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ type AnswerChat struct {
*/

type Options struct {
NumCtx int `json:"num_ctx,omitempty"`

RepeatLastN int `json:"repeat_last_n"`
Temperature float64 `json:"temperature"`
Seed int `json:"seed"`
Expand Down Expand Up @@ -154,6 +156,8 @@ func SetOptions(options map[string]interface{}) Options {
defaultOptions := DefaultOptions()
for key, value := range options {
switch key {
case "NumCtx":
defaultOptions.NumCtx = value.(int)
case "NumPredict":
defaultOptions.NumPredict = value.(int)
case "NumKeep":
Expand Down

0 comments on commit c4d41d8

Please sign in to comment.