ollama/server
Michael Yang 70a93057cd refactor layer creation
previous layer creation was not ideal because:

1. it required reading the input file multiple times, once to calculate
   the sha256 checksum, another to write it to disk, and potentially one
   more to decode the underlying gguf
2. used io.ReadSeeker which is prone to user error. if the file isn't
   reset correctly or in the right place, it could end up reading an
   empty file

there are also some brittleness when reading existing layers else
writing the inherited layers will error reading an already closed file

this commit aims to fix these issues by restructuring layer creation.

1. it will now write the layer to a temporary file as well as the hash
   function and move it to the final location on Commit
2. layers are read once once when copied to the destination. exception
   is raw model files which still requires a second read to decode the
   model metadata
2023-12-04 16:59:23 -08:00
..
auth.go use http.Method 2023-11-02 13:12:45 -07:00
download.go exponential backoff up to 30s 2023-11-19 14:32:19 -05:00
images.go refactor layer creation 2023-12-04 16:59:23 -08:00
images_test.go chat api (#991) 2023-12-04 18:01:06 -05:00
layers.go refactor layer creation 2023-12-04 16:59:23 -08:00
manifests.go refactor layer creation 2023-12-04 16:59:23 -08:00
modelpath.go validate model tags on copy (#1323) 2023-11-29 15:54:29 -05:00
modelpath_test.go use int64 consistently 2023-09-28 11:07:24 -07:00
routes.go chat api (#991) 2023-12-04 18:01:06 -05:00
upload.go upload: fix PUT retry 2023-11-29 16:38:35 -08:00