"...resnet50_onnxruntime.git" did not exist on "4d30cab4774e13f8eea1c733ada5419833b28e16"
Unverified Commit 5296f487 authored by Jeffrey Morgan's avatar Jeffrey Morgan Committed by GitHub
Browse files

llm: attempt to evaluate symlinks, but do not fail (#9089)

provides a better approach to #9088 that will attempt to
evaluate symlinks (important for macOS where 'ollama' is
often a symlink), but use the result of os.Executable()
as a fallback in scenarios where filepath.EvalSymlinks
fails due to permission erorrs or other issues
parent f05774b0
...@@ -19,6 +19,10 @@ var LibOllamaPath string = func() string { ...@@ -19,6 +19,10 @@ var LibOllamaPath string = func() string {
return "" return ""
} }
if eval, err := filepath.EvalSymlinks(exe); err == nil {
exe = eval
}
var libPath string var libPath string
switch runtime.GOOS { switch runtime.GOOS {
case "windows": case "windows":
......
...@@ -320,6 +320,10 @@ func NewLlamaServer(gpus discover.GpuInfoList, model string, f *ggml.GGML, adapt ...@@ -320,6 +320,10 @@ func NewLlamaServer(gpus discover.GpuInfoList, model string, f *ggml.GGML, adapt
return nil, fmt.Errorf("unable to lookup executable path: %w", err) return nil, fmt.Errorf("unable to lookup executable path: %w", err)
} }
if eval, err := filepath.EvalSymlinks(exe); err == nil {
exe = eval
}
// TODO - once fully switched to the Go runner, load the model here for tokenize/detokenize cgo access // TODO - once fully switched to the Go runner, load the model here for tokenize/detokenize cgo access
s := &llmServer{ s := &llmServer{
port: port, port: port,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment