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