shim_ext_server_linux.go 416 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
14
15
16
17
18
19
20
21
22
23
var libEmbed embed.FS

func updatePath(dir string) {
	pathComponents := strings.Split(os.Getenv("PATH"), ":")
	for _, comp := range pathComponents {
		if comp == dir {
			return
		}
	}
	newPath := strings.Join(append(pathComponents, dir), ":")
	log.Printf("Updating PATH to %s", newPath)
	os.Setenv("PATH", newPath)
}