Compare commits
1 Commits
v0.1.29
...
bmizerany/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9ea2e5c7a |
@@ -900,7 +900,8 @@ func NewCLI() *cobra.Command {
|
|||||||
cobra.EnableCommandSorting = false
|
cobra.EnableCommandSorting = false
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
console.ConsoleFromFile(os.Stdin) //nolint:errcheck
|
// Enable colorful ANSI escape code in Windows terminal (disabled by default)
|
||||||
|
console.ConsoleFromFile(os.Stdout) //nolint:errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
rootCmd := &cobra.Command{
|
rootCmd := &cobra.Command{
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
From 9192432daf90b1bfec75577434a99b4ea70d54c8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michael Yang <mxyng@pm.me>
|
|
||||||
Date: Thu, 14 Mar 2024 12:09:50 -0700
|
|
||||||
Subject: [PATCH] fix clip free
|
|
||||||
|
|
||||||
---
|
|
||||||
examples/llava/clip.cpp | 4 ++++
|
|
||||||
examples/server/server.cpp | 6 ++++++
|
|
||||||
2 files changed, 10 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp
|
|
||||||
index ef9e4ba7..b4ddfe6b 100644
|
|
||||||
--- a/examples/llava/clip.cpp
|
|
||||||
+++ b/examples/llava/clip.cpp
|
|
||||||
@@ -1673,6 +1673,10 @@ void clip_free(clip_ctx * ctx) {
|
|
||||||
ggml_free(ctx->ctx_data);
|
|
||||||
gguf_free(ctx->ctx_gguf);
|
|
||||||
|
|
||||||
+ ggml_backend_buffer_free(ctx->params_buffer);
|
|
||||||
+ ggml_backend_buffer_free(ctx->compute_buffer);
|
|
||||||
+ ggml_backend_free(ctx->backend);
|
|
||||||
+ ggml_gallocr_free(ctx->compute_alloc);
|
|
||||||
delete ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/examples/server/server.cpp b/examples/server/server.cpp
|
|
||||||
index 8fe5e0b1..f927336b 100644
|
|
||||||
--- a/examples/server/server.cpp
|
|
||||||
+++ b/examples/server/server.cpp
|
|
||||||
@@ -353,6 +353,12 @@ struct llama_server_context
|
|
||||||
|
|
||||||
~llama_server_context()
|
|
||||||
{
|
|
||||||
+ if (clp_ctx)
|
|
||||||
+ {
|
|
||||||
+ LOG_INFO("freeing clip model", {});
|
|
||||||
+ clip_free(clp_ctx);
|
|
||||||
+ clp_ctx = nullptr;
|
|
||||||
+ }
|
|
||||||
if (ctx)
|
|
||||||
{
|
|
||||||
llama_free(ctx);
|
|
||||||
--
|
|
||||||
2.43.2
|
|
||||||
|
|
||||||
@@ -795,10 +795,8 @@ func PruneLayers() error {
|
|||||||
|
|
||||||
for _, blob := range blobs {
|
for _, blob := range blobs {
|
||||||
name := blob.Name()
|
name := blob.Name()
|
||||||
if runtime.GOOS == "windows" {
|
name = strings.ReplaceAll(name, "-", ":")
|
||||||
name = strings.ReplaceAll(name, "-", ":")
|
if strings.HasPrefix(name, "sha256-") {
|
||||||
}
|
|
||||||
if strings.HasPrefix(name, "sha256:") {
|
|
||||||
deleteMap[name] = struct{}{}
|
deleteMap[name] = struct{}{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
@@ -47,10 +46,7 @@ func NewLayer(r io.Reader, mediatype string) (*Layer, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
delimiter := ":"
|
const delimiter = "-"
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
delimiter = "-"
|
|
||||||
}
|
|
||||||
|
|
||||||
pattern := strings.Join([]string{"sha256", "*-partial"}, delimiter)
|
pattern := strings.Join([]string{"sha256", "*-partial"}, delimiter)
|
||||||
temp, err := os.CreateTemp(blobs, pattern)
|
temp, err := os.CreateTemp(blobs, pattern)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -150,10 +149,7 @@ func GetBlobsPath(digest string) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
digest = strings.ReplaceAll(digest, ":", "-")
|
||||||
digest = strings.ReplaceAll(digest, ":", "-")
|
|
||||||
}
|
|
||||||
|
|
||||||
path := filepath.Join(dir, "blobs", digest)
|
path := filepath.Join(dir, "blobs", digest)
|
||||||
dirPath := filepath.Dir(path)
|
dirPath := filepath.Dir(path)
|
||||||
if digest == "" {
|
if digest == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user