mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-25 04:54:59 +00:00
feat(llama.cpp): estimate vram usage
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
bace6516f1
commit
7f654fece7
7 changed files with 131 additions and 21 deletions
|
@ -4,9 +4,8 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/mudler/LocalAI/pkg/xsysinfo"
|
||||
gguf "github.com/gpustack/gguf-parser-go"
|
||||
"github.com/rs/zerolog/log"
|
||||
gguf "github.com/thxcode/gguf-parser-go"
|
||||
)
|
||||
|
||||
func guessDefaultsFromFile(cfg *BackendConfig, modelPath string, defaultCtx int) {
|
||||
|
@ -36,10 +35,4 @@ func guessDefaultsFromFile(cfg *BackendConfig, modelPath string, defaultCtx int)
|
|||
}
|
||||
cfg.ContextSize = &defaultCtx
|
||||
}
|
||||
|
||||
if cfg.Options == nil {
|
||||
if xsysinfo.HasGPU("nvidia") || xsysinfo.HasGPU("amd") {
|
||||
cfg.Options = []string{"gpu"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue