shim_ext_server_linux.go 462 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
package llm

import (
	"embed"
	"log"
	"os"
	"strings"
)

10
//go:embed llama.cpp/build/*/*/lib/*.so
11
12
13
var libEmbed embed.FS

func updatePath(dir string) {
14
	pathComponents := strings.Split(os.Getenv("LD_LIBRARY_PATH"), ":")
15
16
17
18
19
	for _, comp := range pathComponents {
		if comp == dir {
			return
		}
	}
20
21
22
	newPath := strings.Join(append([]string{dir}, pathComponents...), ":")
	log.Printf("Updating LD_LIBRARY_PATH to %s", newPath)
	os.Setenv("LD_LIBRARY_PATH", newPath)
23
}