mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-12 00:37:04 +00:00
Carry ggml-metal.metal as payload
This commit is contained in:
@@ -1,18 +1,32 @@
|
||||
package llm
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/jmorganca/ollama/api"
|
||||
)
|
||||
|
||||
// no-op stubs for mac
|
||||
//go:embed llama.cpp/gguf/build/*/bin/ggml-metal.metal
|
||||
var libEmbed embed.FS
|
||||
|
||||
func newRocmShimExtServer(model string, adapters, projectors []string, numLayers int64, opts api.Options) (extServer, error) {
|
||||
// should never happen...
|
||||
return nil, fmt.Errorf("ROCM GPUs not supported on Mac")
|
||||
}
|
||||
|
||||
func nativeInit(workDir string) error {
|
||||
func nativeInit(workdir string) error {
|
||||
err := extractLib(workdir, "llama.cpp/gguf/build/*/bin/ggml-metal.metal")
|
||||
if err != nil {
|
||||
if err == payloadMissing {
|
||||
// TODO perhaps consider this a hard failure on arm macs?
|
||||
log.Printf("ggml-meta.metal payload missing")
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
os.Setenv("GGML_METAL_PATH_RESOURCES", workdir)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user