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
5784c053
Unverified
Commit
5784c053
authored
Jul 22, 2024
by
Daniel Hiltgen
Committed by
GitHub
Jul 22, 2024
Browse files
Merge pull request #5854 from dhiltgen/win_exit_status
Refine error reporting for subprocess crash
parents
f14aa543
a3c20e3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
llm/server.go
llm/server.go
+12
-9
No files found.
llm/server.go
View file @
5784c053
...
...
@@ -417,7 +417,17 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
// reap subprocess when it exits
go
func
()
{
s
.
done
<-
s
.
cmd
.
Wait
()
err
:=
s
.
cmd
.
Wait
()
// Favor a more detailed message over the process exit status
if
err
!=
nil
&&
s
.
status
!=
nil
&&
s
.
status
.
LastErrMsg
!=
""
{
slog
.
Debug
(
"llama runner terminated"
,
"error"
,
err
)
if
strings
.
Contains
(
s
.
status
.
LastErrMsg
,
"unknown model"
)
{
s
.
status
.
LastErrMsg
=
"this model is not supported by your version of Ollama. You may need to upgrade"
}
s
.
done
<-
fmt
.
Errorf
(
s
.
status
.
LastErrMsg
)
}
else
{
s
.
done
<-
err
}
}()
return
s
,
nil
...
...
@@ -580,14 +590,7 @@ func (s *llmServer) WaitUntilRunning(ctx context.Context) error {
slog
.
Warn
(
"client connection closed before server finished loading, aborting load"
)
return
fmt
.
Errorf
(
"timed out waiting for llama runner to start: %w"
,
ctx
.
Err
())
case
err
:=
<-
s
.
done
:
msg
:=
""
if
s
.
status
!=
nil
&&
s
.
status
.
LastErrMsg
!=
""
{
msg
=
s
.
status
.
LastErrMsg
}
if
strings
.
Contains
(
msg
,
"unknown model"
)
{
return
fmt
.
Errorf
(
"this model is not supported by your version of Ollama. You may need to upgrade"
)
}
return
fmt
.
Errorf
(
"llama runner process has terminated: %v %s"
,
err
,
msg
)
return
fmt
.
Errorf
(
"llama runner process has terminated: %w"
,
err
)
default
:
}
if
time
.
Now
()
.
After
(
stallTimer
)
{
...
...
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