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

@@ -4,7 +4,6 @@ import (
"encoding/binary"
"errors"
"io"
"sync"
)
type GGML struct {
@@ -165,18 +164,6 @@ func (c *containerLORA) Decode(r io.Reader) (model, error) {
return nil, nil
}
var (
ggmlInit sync.Once
ggmlRunners []ModelRunner // a slice of ModelRunners ordered by priority
)
func ggmlRunner() []ModelRunner {
ggmlInit.Do(func() {
ggmlRunners = chooseRunners("ggml")
})
return ggmlRunners
}
const (
// Magic constant for `ggml` files (unversioned).
FILE_MAGIC_GGML = 0x67676d6c