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
commit 7efbc84320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)
}