Skip to content

Commit

Permalink
fix: rename metal resource for avoid conflict with whisper.rn
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Oct 25, 2023
1 parent adb7545 commit dade596
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion cpp/ggml-metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void lm_ggml_metal_log(enum lm_ggml_log_level level, const char* format,
} else {
LM_GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__);

NSString * sourcePath = [bundle pathForResource:@"ggml-metal" ofType:@"metal"];
NSString * sourcePath = [bundle pathForResource:@"ggml-metal-llama" ofType:@"metal"];
LM_GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [sourcePath UTF8String]);
NSString * src = [NSString stringWithContentsOfFile:sourcePath encoding:NSUTF8StringEncoding error:&error];
if (error) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cp ./llama.cpp/ggml.h ./cpp/ggml.h
cp ./llama.cpp/ggml.c ./cpp/ggml.c
cp ./llama.cpp/ggml-metal.h ./cpp/ggml-metal.h
cp ./llama.cpp/ggml-metal.m ./cpp/ggml-metal.m
cp ./llama.cpp/ggml-metal.metal ./cpp/ggml-metal.metal
cp ./llama.cpp/ggml-metal.metal ./cpp/ggml-metal-llama.metal
cp ./llama.cpp/ggml-alloc.h ./cpp/ggml-alloc.h
cp ./llama.cpp/ggml-alloc.c ./cpp/ggml-alloc.c
cp ./llama.cpp/ggml-backend.h ./cpp/ggml-backend.h
Expand Down Expand Up @@ -69,3 +69,4 @@ yarn example
# Apply patch
patch -p0 -d ./cpp < ./scripts/log.h.patch
patch -p0 -d ./cpp < ./scripts/llama.cpp.patch
patch -p0 -d ./cpp < ./scripts/ggml-metal.m.patch
11 changes: 11 additions & 0 deletions scripts/ggml-metal.m.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ggml-metal.m.orig 2023-10-25 10:31:15
+++ ggml-metal.m 2023-10-25 10:31:37
@@ -208,7 +208,7 @@
} else {
LM_GGML_METAL_LOG_INFO("%s: default.metallib not found, loading from source\n", __func__);

- NSString * sourcePath = [bundle pathForResource:@"ggml-metal" ofType:@"metal"];
+ NSString * sourcePath = [bundle pathForResource:@"ggml-metal-llama" ofType:@"metal"];
LM_GGML_METAL_LOG_INFO("%s: loading '%s'\n", __func__, [sourcePath UTF8String]);
NSString * src = [NSString stringWithContentsOfFile:sourcePath encoding:NSUTF8StringEncoding error:&error];
if (error) {

0 comments on commit dade596

Please sign in to comment.