Commit e26085b9 authored by Michael Yang's avatar Michael Yang
Browse files

close open files

parent 2ab20095
...@@ -39,6 +39,7 @@ func initBackend() error { ...@@ -39,6 +39,7 @@ func initBackend() error {
if err != nil { if err != nil {
return err return err
} }
defer actual.Close()
actualSum := sha256.New() actualSum := sha256.New()
if _, err := io.Copy(actualSum, actual); err != nil { if _, err := io.Copy(actualSum, actual); err != nil {
......
...@@ -28,6 +28,7 @@ func New(model string, adapters []string, opts api.Options) (LLM, error) { ...@@ -28,6 +28,7 @@ func New(model string, adapters []string, opts api.Options) (LLM, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer f.Close()
ggml, err := DecodeGGML(f, ModelFamilyLlama) ggml, err := DecodeGGML(f, ModelFamilyLlama)
if err != nil { if err != nil {
......
...@@ -1117,6 +1117,7 @@ func uploadBlobChunked(ctx context.Context, mp ModelPath, url string, layer *Lay ...@@ -1117,6 +1117,7 @@ func uploadBlobChunked(ctx context.Context, mp ModelPath, url string, layer *Lay
if err != nil { if err != nil {
return err return err
} }
defer f.Close()
totalUploaded := 0 totalUploaded := 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment