mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 18:36:41 +02:00
config: allow setting context length through env var (#8938)
* envconfig: allow setting context length through env var
This commit is contained in:
parent
4604b10306
commit
314573bfe8
4 changed files with 23 additions and 1 deletions
|
@ -10,6 +10,8 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ollama/ollama/envconfig"
|
||||
)
|
||||
|
||||
// StatusError is an error with an HTTP status code and message.
|
||||
|
@ -609,7 +611,7 @@ func DefaultOptions() Options {
|
|||
|
||||
Runner: Runner{
|
||||
// options set when the model is loaded
|
||||
NumCtx: 2048,
|
||||
NumCtx: int(envconfig.ContextLength()),
|
||||
NumBatch: 512,
|
||||
NumGPU: -1, // -1 here indicates that NumGPU should be set dynamically
|
||||
NumThread: 0, // let the runtime decide
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue