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
9c2941e6
Unverified
Commit
9c2941e6
authored
Jan 05, 2024
by
Patrick Devine
Committed by
GitHub
Jan 05, 2024
Browse files
switch api for ShowRequest to use the name field (#1816)
parent
238ac5e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
cmd/cmd.go
cmd/cmd.go
+2
-2
cmd/interactive.go
cmd/interactive.go
+2
-2
No files found.
cmd/cmd.go
View file @
9c2941e6
...
@@ -149,7 +149,7 @@ func RunHandler(cmd *cobra.Command, args []string) error {
...
@@ -149,7 +149,7 @@ func RunHandler(cmd *cobra.Command, args []string) error {
name
:=
args
[
0
]
name
:=
args
[
0
]
// check if the model exists on the server
// check if the model exists on the server
model
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
api
.
ShowRequest
{
Model
:
name
})
model
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
api
.
ShowRequest
{
Name
:
name
})
var
statusError
api
.
StatusError
var
statusError
api
.
StatusError
switch
{
switch
{
case
errors
.
As
(
err
,
&
statusError
)
&&
statusError
.
StatusCode
==
http
.
StatusNotFound
:
case
errors
.
As
(
err
,
&
statusError
)
&&
statusError
.
StatusCode
==
http
.
StatusNotFound
:
...
@@ -335,7 +335,7 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
...
@@ -335,7 +335,7 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
return
errors
.
New
(
"one of '--license', '--modelfile', '--parameters', '--system', or '--template' must be specified"
)
return
errors
.
New
(
"one of '--license', '--modelfile', '--parameters', '--system', or '--template' must be specified"
)
}
}
req
:=
api
.
ShowRequest
{
Model
:
args
[
0
]}
req
:=
api
.
ShowRequest
{
Name
:
args
[
0
]}
resp
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
req
)
resp
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
req
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
cmd/interactive.go
View file @
9c2941e6
...
@@ -34,7 +34,7 @@ func modelIsMultiModal(cmd *cobra.Command, name string) bool {
...
@@ -34,7 +34,7 @@ func modelIsMultiModal(cmd *cobra.Command, name string) bool {
return
false
return
false
}
}
req
:=
api
.
ShowRequest
{
Model
:
name
}
req
:=
api
.
ShowRequest
{
Name
:
name
}
resp
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
req
)
resp
,
err
:=
client
.
Show
(
cmd
.
Context
(),
&
req
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
return
false
...
@@ -293,7 +293,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
...
@@ -293,7 +293,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
return
err
return
err
}
}
req
:=
&
api
.
ShowRequest
{
req
:=
&
api
.
ShowRequest
{
Model
:
opts
.
Model
,
Name
:
opts
.
Model
,
System
:
opts
.
System
,
System
:
opts
.
System
,
Template
:
opts
.
Template
,
Template
:
opts
.
Template
,
Options
:
opts
.
Options
,
Options
:
opts
.
Options
,
...
...
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