mirror of
https://github.com/ollama/ollama.git
synced 2025-05-22 16:20:21 +02:00
fix: ollama host for hostname
This commit is contained in:
parent
cbfff4f868
commit
459f4a7889
@ -52,8 +52,10 @@ func ClientFromEnvironment() (*Client, error) {
|
|||||||
host, port, err := net.SplitHostPort(hostport)
|
host, port, err := net.SplitHostPort(hostport)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
host, port = "127.0.0.1", "11434"
|
host, port = "127.0.0.1", "11434"
|
||||||
if ip := net.ParseIP(strings.Trim(os.Getenv("OLLAMA_HOST"), "[]")); ip != nil {
|
if ip := net.ParseIP(strings.Trim(hostport, "[]")); ip != nil {
|
||||||
host = ip.String()
|
host = ip.String()
|
||||||
|
} else if hostport != "" {
|
||||||
|
host = hostport
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user