This commit is contained in:
Josh Yan 2024-07-23 13:46:34 -07:00
parent 33848ad10f
commit 5c3786f4d5

View File

@ -282,12 +282,11 @@ func createBlob(cmd *cobra.Command, path string) (string, error) {
digest := fmt.Sprintf("sha256:%x", hash.Sum(nil))
// We check if we can find the models directory locally
// If we can, we return the path to the directory
// If we can't, we return an error
// If the blob exists already, we return the digest
// Use our new CreateBlob request which will include the file path
// The server checks for that file and if the server is local, it will copy the file over
// If the local copy fails, the server will continue to the default local copy
// If that fails, it will continue with the server POST
err = CreateBlob(cmd.Context(), path, digest)
if errors.Is(err, ErrBlobExists) {
return digest, nil
}