Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
553c8844
Commit
553c8844
authored
Jul 07, 2023
by
Jeffrey Morgan
Browse files
allow specifying server host and port with `OLLAMA_HOST` and `OLLAMA_PORT`
parent
b245f5af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
cmd/cmd.go
cmd/cmd.go
+11
-1
No files found.
cmd/cmd.go
View file @
553c8844
...
@@ -153,7 +153,17 @@ func generateBatch(model string) error {
...
@@ -153,7 +153,17 @@ func generateBatch(model string) error {
}
}
func
RunServer
(
_
*
cobra
.
Command
,
_
[]
string
)
error
{
func
RunServer
(
_
*
cobra
.
Command
,
_
[]
string
)
error
{
ln
,
err
:=
net
.
Listen
(
"tcp"
,
"127.0.0.1:11434"
)
host
:=
os
.
Getenv
(
"OLLAMA_HOST"
)
if
host
==
""
{
host
=
"127.0.0.1"
}
port
:=
os
.
Getenv
(
"OLLAMA_PORT"
)
if
port
==
""
{
port
=
"11434"
}
ln
,
err
:=
net
.
Listen
(
"tcp"
,
fmt
.
Sprintf
(
"%s:%s"
,
host
,
port
))
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment