Skip to content

Commit

Permalink
Add LowVRAM option parameter (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler authored Jun 20, 2023
1 parent 4e3c319 commit 2f5feb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Config struct {
NGPULayers int `yaml:"gpu_layers"`
MMap bool `yaml:"mmap"`
MMlock bool `yaml:"mmlock"`
LowVRAM bool `yaml:"low_vram"`

TensorSplit string `yaml:"tensor_split"`
MainGPU string `yaml:"main_gpu"`
Expand Down
4 changes: 4 additions & 0 deletions api/prediction.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func defaultLLamaOpts(c Config) []llama.ModelOption {
llamaOpts = append(llamaOpts, llama.SetNBatch(512))
}

if c.LowVRAM {
llamaOpts = append(llamaOpts, llama.EnabelLowVRAM)
}

return llamaOpts
}

Expand Down

0 comments on commit 2f5feb4

Please sign in to comment.