From 7f181600c77efb48a1b2a2e30ff0cd50c294ebea Mon Sep 17 00:00:00 2001 From: Hyun-joo KIM Date: Fri, 9 Jun 2023 01:24:22 +0900 Subject: [PATCH] Metal inference enhancement - put hard-wired relative path of ggml-model.model file due to lack of NSBundle environment --- ggml-metal.m.diff | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ggml-metal.m.diff diff --git a/ggml-metal.m.diff b/ggml-metal.m.diff new file mode 100644 index 000000000..52070cac6 --- /dev/null +++ b/ggml-metal.m.diff @@ -0,0 +1,11 @@ +--- ggml-metal.m 2023-06-09 00:52:44 ++++ ggml-metal.m 2023-06-09 00:52:31 +@@ -99,7 +99,7 @@ + NSError * error = nil; + + //NSString * path = [[NSBundle mainBundle] pathForResource:@"../../examples/metal/metal" ofType:@"metal"]; +- NSString * path = [[NSBundle mainBundle] pathForResource:@"ggml-metal" ofType:@"metal"]; ++ NSString * path = @"./ggml-metal.metal"; + fprintf(stderr, "%s: loading '%s'\n", __func__, [path UTF8String]); + + NSString * src = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];