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
4b77fcb2
Commit
4b77fcb2
authored
Dec 01, 2023
by
Michael Yang
Browse files
comments
parent
cde13bcd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
cmd/cmd.go
cmd/cmd.go
+6
-5
No files found.
cmd/cmd.go
View file @
4b77fcb2
...
...
@@ -1038,8 +1038,6 @@ func checkServerHeartbeat(cmd *cobra.Command, _ []string) error {
}
func
versionHandler
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
fmt
.
Printf
(
"ollama version %s
\n
"
,
version
.
Version
)
client
,
err
:=
api
.
ClientFromEnvironment
()
if
err
!=
nil
{
return
...
...
@@ -1047,11 +1045,15 @@ func versionHandler(cmd *cobra.Command, _ []string) {
serverVersion
,
err
:=
client
.
Version
(
cmd
.
Context
())
if
err
!=
nil
{
return
fmt
.
Println
(
"Warning: could not connect to a running Ollama instance"
)
}
if
serverVersion
!=
""
{
fmt
.
Printf
(
"ollama version is %s
\n
"
,
serverVersion
)
}
if
serverVersion
!=
version
.
Version
{
fmt
.
Printf
(
"
ollama hos
t version %s
\n
"
,
ser
verVersion
)
fmt
.
Printf
(
"
Warning: clien
t version
is
%s
\n
"
,
ver
sion
.
Version
)
}
}
...
...
@@ -1067,7 +1069,6 @@ func NewCLI() *cobra.Command {
CompletionOptions
:
cobra
.
CompletionOptions
{
DisableDefaultCmd
:
true
,
},
Version
:
version
.
Version
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
if
version
,
_
:=
cmd
.
Flags
()
.
GetBool
(
"version"
);
version
{
versionHandler
(
cmd
,
args
)
...
...
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