shim_ext_server_linux.go 462 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("LD_LIBRARY_PATH"), ":")
  12. for _, comp := range pathComponents {
  13. if comp == dir {
  14. return
  15. }
  16. }
  17. newPath := strings.Join(append([]string{dir}, pathComponents...), ":")
  18. log.Printf("Updating LD_LIBRARY_PATH to %s", newPath)
  19. os.Setenv("LD_LIBRARY_PATH", newPath)
  20. }