Unverified Commit 7efbc843 authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #464 from jmorganca/mxyng/fix-num-keep

fix num_keep
parents 8dc68417 681f3c4c
...@@ -117,12 +117,13 @@ func load(ctx context.Context, model *Model, reqOpts map[string]interface{}, ses ...@@ -117,12 +117,13 @@ func load(ctx context.Context, model *Model, reqOpts map[string]interface{}, ses
if err != nil { if err != nil {
return err return err
} }
tokensNoSystem, err := llmModel.Encode(ctx, promptNoSystem) tokensNoSystem, err := llmModel.Encode(ctx, promptNoSystem)
if err != nil { if err != nil {
return err return err
} }
opts.NumKeep = len(tokensWithSystem) - len(tokensNoSystem) + 1 opts.NumKeep = len(tokensWithSystem) - len(tokensNoSystem)
llmModel.SetOptions(opts) llmModel.SetOptions(opts)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment