ollama/llm/shim_ext_server_linux.go

24 lines
416 B
Go
Raw Normal View History

package llm
import (
"embed"
"log"
"os"
"strings"
)
2024-01-04 12:40:15 -05:00
//go:embed llama.cpp/build/*/*/lib/*.so
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)
}