subprocess improvements (#524)

* subprocess improvements

- increase start-up timeout
- when runner fails to start fail rather than timing out
- try runners in order rather than choosing 1 runner
- embed metal runner in metal dir rather than gpu
- refactor logging and error messages

* Update llama.go

* Update llama.go

* simplify by using glob
This commit is contained in:
Bruce MacDonald
2023-09-18 15:16:32 -04:00
committed by GitHub
parent c345053a8b
commit 66003e1d05
4 changed files with 121 additions and 106 deletions

View File

@@ -370,14 +370,14 @@ func (llm *ggufModel) readArray(r io.Reader) (arr []any, err error) {
}
var (
ggufInit sync.Once
ggufRunnerPath string
ggufInit sync.Once
ggufRunners []ModelRunner // a slice of ModelRunners ordered by priority
)
func ggufRunner() ModelRunner {
func ggufRunner() []ModelRunner {
ggufInit.Do(func() {
ggufRunnerPath = chooseRunner("gguf")
ggufRunners = chooseRunners("gguf")
})
return ModelRunner{Path: ggufRunnerPath}
return ggufRunners
}