llm: limit generation to 10x context size to avoid run on generations (#3918)

* llm: limit generation to 10x context size to avoid run on generations

* add comment

* simplify condition statement
This commit is contained in:
Jeffrey Morgan
2024-04-25 19:02:30 -04:00
committed by GitHub
parent 5f73c08729
commit 993cf8bf55
2 changed files with 11 additions and 2 deletions

View File

@@ -396,8 +396,10 @@ func (opts *Options) FromMap(m map[string]interface{}) error {
func DefaultOptions() Options {
return Options{
// options set on request to runner
NumPredict: -1,
NumKeep: 0,
NumPredict: -1,
// set a minimal num_keep to avoid issues on context shifts
NumKeep: 4,
Temperature: 0.8,
TopK: 40,
TopP: 0.9,