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

@@ -166,15 +166,15 @@ func (c *containerLORA) Decode(r io.Reader) (model, error) {
}
var (
ggmlInit sync.Once
ggmlRunnerPath string
ggmlInit sync.Once
ggmlRunners []ModelRunner // a slice of ModelRunners ordered by priority
)
func ggmlRunner() ModelRunner {
func ggmlRunner() []ModelRunner {
ggmlInit.Do(func() {
ggmlRunnerPath = chooseRunner("ggml")
ggmlRunners = chooseRunners("ggml")
})
return ModelRunner{Path: ggmlRunnerPath}
return ggmlRunners
}
const (