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

fix num_keep
This commit is contained in:
Michael Yang
2023-09-05 11:30:45 -07:00
committed by GitHub

View File

@@ -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)
if err != nil {
return err
}
opts.NumKeep = len(tokensWithSystem) - len(tokensNoSystem) + 1
opts.NumKeep = len(tokensWithSystem) - len(tokensNoSystem)
llmModel.SetOptions(opts)
}