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
orangecat
ollama
Commits
8bccae4f
Unverified
Commit
8bccae4f
authored
Jan 09, 2025
by
Patrick Devine
Committed by
GitHub
Jan 09, 2025
Browse files
show a more descriptive error in the client if it is newer than the server (#8351)
parent
6ae2adc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
cmd/cmd.go
cmd/cmd.go
+3
-0
server/create.go
server/create.go
+2
-1
No files found.
cmd/cmd.go
View file @
8bccae4f
...
...
@@ -162,6 +162,9 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
}
if
err
:=
client
.
Create
(
cmd
.
Context
(),
req
,
fn
);
err
!=
nil
{
if
strings
.
Contains
(
err
.
Error
(),
"path or Modelfile are required"
)
{
return
fmt
.
Errorf
(
"the ollama server must be updated to use `ollama create` with this client"
)
}
return
err
}
...
...
server/create.go
View file @
8bccae4f
...
...
@@ -33,6 +33,7 @@ var (
errOnlyOneAdapterSupported
=
errors
.
New
(
"only one adapter is currently supported"
)
errOnlyGGUFSupported
=
errors
.
New
(
"supplied file was not in GGUF format"
)
errUnknownType
=
errors
.
New
(
"unknown type"
)
errNeitherFromOrFiles
=
errors
.
New
(
"neither 'from' or 'files' was specified"
)
)
func
(
s
*
Server
)
CreateHandler
(
c
*
gin
.
Context
)
{
...
...
@@ -95,7 +96,7 @@ func (s *Server) CreateHandler(c *gin.Context) {
return
}
}
else
{
ch
<-
gin
.
H
{
"error"
:
"n
either
'from' or 'files' was specified"
,
"status"
:
http
.
StatusBadRequest
}
ch
<-
gin
.
H
{
"error"
:
errN
either
FromOrFiles
.
Error
()
,
"status"
:
http
.
StatusBadRequest
}
return
}
...
...
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