shim_ext_server_linux.go 416 B

1234567891011121314151617181920212223
  1. package llm
  2. import (
  3. "embed"
  4. "log"
  5. "os"
  6. "strings"
  7. )
  8. //go:embed llama.cpp/build/*/*/lib/*.so
  9. var libEmbed embed.FS
  10. func updatePath(dir string) {
  11. pathComponents := strings.Split(os.Getenv("PATH"), ":")
  12. for _, comp := range pathComponents {
  13. if comp == dir {
  14. return
  15. }
  16. }
  17. newPath := strings.Join(append(pathComponents, dir), ":")
  18. log.Printf("Updating PATH to %s", newPath)
  19. os.Setenv("PATH", newPath)
  20. }