close open files

This commit is contained in:
Michael Yang 2023-08-14 16:08:02 -07:00
parent 2ab20095b3
commit e26085b921
3 changed files with 3 additions and 0 deletions

View file

@ -39,6 +39,7 @@ func initBackend() error {
if err != nil {
return err
}
defer actual.Close()
actualSum := sha256.New()
if _, err := io.Copy(actualSum, actual); err != nil {

View file

@ -28,6 +28,7 @@ func New(model string, adapters []string, opts api.Options) (LLM, error) {
if err != nil {
return nil, err
}
defer f.Close()
ggml, err := DecodeGGML(f, ModelFamilyLlama)
if err != nil {

View file

@ -1117,6 +1117,7 @@ func uploadBlobChunked(ctx context.Context, mp ModelPath, url string, layer *Lay
if err != nil {
return err
}
defer f.Close()
totalUploaded := 0