remove tmp directories created by previous servers (#559)

* remove tmp directories created by previous servers

* clean up on server stop

* Update routes.go

* Update server/routes.go

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>

* create top-level temp ollama dir

* check file exists before creating

---------

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
Co-authored-by: Michael Yang <mxyng@pm.me>
This commit is contained in:
Bruce MacDonald
2023-09-21 20:38:49 +01:00
committed by GitHub
parent 8c83701e9f
commit 4cba75efc5
6 changed files with 56 additions and 60 deletions

View File

@@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"sync"
)
type containerGGUF struct {
@@ -368,16 +367,3 @@ func (llm *ggufModel) readArray(r io.Reader) (arr []any, err error) {
return
}
var (
ggufInit sync.Once
ggufRunners []ModelRunner // a slice of ModelRunners ordered by priority
)
func ggufRunner() []ModelRunner {
ggufInit.Do(func() {
ggufRunners = chooseRunners("gguf")
})
return ggufRunners
}