fix num_keep
@@ -117,12 +117,13 @@ func load(ctx context.Context, model *Model, reqOpts map[string]interface{}, ses
if err != nil {
return err
}
+
tokensNoSystem, err := llmModel.Encode(ctx, promptNoSystem)
- opts.NumKeep = len(tokensWithSystem) - len(tokensNoSystem) + 1
+ opts.NumKeep = len(tokensWithSystem) - len(tokensNoSystem)
llmModel.SetOptions(opts)