mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-08 04:05:20 +00:00
fix metal
This commit is contained in:
parent
080b600865
commit
dded27dcfa
@ -377,8 +377,8 @@ static struct ggml_metal_context * ggml_metal_init(int n_cb) {
|
|||||||
#if GGML_METAL_EMBED_LIBRARY
|
#if GGML_METAL_EMBED_LIBRARY
|
||||||
GGML_METAL_LOG_INFO("%s: using embedded metal library\n", __func__);
|
GGML_METAL_LOG_INFO("%s: using embedded metal library\n", __func__);
|
||||||
|
|
||||||
extern const char ggml_metallib_start[];
|
extern const char *ggml_metallib_start;
|
||||||
extern const char ggml_metallib_end[];
|
extern const char *ggml_metallib_end;
|
||||||
|
|
||||||
NSString * src = [[NSString alloc] initWithBytes:ggml_metallib_start length:(ggml_metallib_end-ggml_metallib_start) encoding:NSUTF8StringEncoding];
|
NSString * src = [[NSString alloc] initWithBytes:ggml_metallib_start length:(ggml_metallib_end-ggml_metallib_start) encoding:NSUTF8StringEncoding];
|
||||||
#else
|
#else
|
||||||
|
@ -37,8 +37,8 @@ package llama
|
|||||||
#include "sampling_ext.h"
|
#include "sampling_ext.h"
|
||||||
|
|
||||||
bool llamaProgressCallback(float progress, void *user_data);
|
bool llamaProgressCallback(float progress, void *user_data);
|
||||||
extern const char* ggml_metallib_start;
|
extern const char *ggml_metallib_start;
|
||||||
extern const char* ggml_metallib_end;
|
extern const char *ggml_metallib_end;
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
const char* ggml_metallib_start = 0;
|
const char *ggml_metallib_start;
|
||||||
const char* ggml_metallib_end = 0;
|
const char *ggml_metallib_end;
|
||||||
|
15
llama/patches/04-ggml-metal.diff
Normal file
15
llama/patches/04-ggml-metal.diff
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
diff --git a/llama/ggml-metal-darwin_arm64.m b/llama/ggml-metal-darwin_arm64.m
|
||||||
|
index b56c3604..400d43f4 100644
|
||||||
|
--- a/llama/ggml-metal-darwin_arm64.m
|
||||||
|
+++ b/llama/ggml-metal-darwin_arm64.m
|
||||||
|
@@ -377,8 +377,8 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
|
||||||
|
#if GGML_METAL_EMBED_LIBRARY
|
||||||
|
GGML_METAL_LOG_INFO("%s: using embedded metal library\n", __func__);
|
||||||
|
|
||||||
|
- extern const char ggml_metallib_start[];
|
||||||
|
- extern const char ggml_metallib_end[];
|
||||||
|
+ extern const char *ggml_metallib_start;
|
||||||
|
+ extern const char *ggml_metallib_end;
|
||||||
|
|
||||||
|
NSString * src = [[NSString alloc] initWithBytes:ggml_metallib_start length:(ggml_metallib_end-ggml_metallib_start) encoding:NSUTF8StringEncoding];
|
||||||
|
#else
|
Loading…
x
Reference in New Issue
Block a user