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
d7339fad
Unverified
Commit
d7339fad
authored
May 28, 2024
by
Daniel Hiltgen
Committed by
GitHub
May 28, 2024
Browse files
Merge pull request #4682 from dhiltgen/more_time
Give the final model loading more time
parents
9db0996e
92c81e81
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
llm/server.go
llm/server.go
+8
-2
No files found.
llm/server.go
View file @
d7339fad
...
@@ -519,11 +519,13 @@ func (s *llmServer) Ping(ctx context.Context) error {
...
@@ -519,11 +519,13 @@ func (s *llmServer) Ping(ctx context.Context) error {
func
(
s
*
llmServer
)
WaitUntilRunning
(
ctx
context
.
Context
)
error
{
func
(
s
*
llmServer
)
WaitUntilRunning
(
ctx
context
.
Context
)
error
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
stallDuration
:=
60
*
time
.
Second
stallDuration
:=
5
*
time
.
Minute
// If no progress happens
stallTimer
:=
time
.
Now
()
.
Add
(
stallDuration
)
// give up if we stall for
finalLoadDuration
:=
5
*
time
.
Minute
// After we hit 100%, give the runner more time to come online
stallTimer
:=
time
.
Now
()
.
Add
(
stallDuration
)
// give up if we stall
slog
.
Info
(
"waiting for llama runner to start responding"
)
slog
.
Info
(
"waiting for llama runner to start responding"
)
var
lastStatus
ServerStatus
=
-
1
var
lastStatus
ServerStatus
=
-
1
fullyLoaded
:=
false
for
{
for
{
select
{
select
{
...
@@ -572,6 +574,10 @@ func (s *llmServer) WaitUntilRunning(ctx context.Context) error {
...
@@ -572,6 +574,10 @@ func (s *llmServer) WaitUntilRunning(ctx context.Context) error {
if
priorProgress
!=
s
.
loadProgress
{
if
priorProgress
!=
s
.
loadProgress
{
slog
.
Debug
(
fmt
.
Sprintf
(
"model load progress %0.2f"
,
s
.
loadProgress
))
slog
.
Debug
(
fmt
.
Sprintf
(
"model load progress %0.2f"
,
s
.
loadProgress
))
stallTimer
=
time
.
Now
()
.
Add
(
stallDuration
)
stallTimer
=
time
.
Now
()
.
Add
(
stallDuration
)
}
else
if
!
fullyLoaded
&&
int
(
s
.
loadProgress
*
100.0
)
>=
100
{
slog
.
Debug
(
"model load completed, waiting for server to become available"
,
"status"
,
status
.
ToString
())
stallTimer
=
time
.
Now
()
.
Add
(
finalLoadDuration
)
fullyLoaded
=
true
}
}
time
.
Sleep
(
time
.
Millisecond
*
250
)
time
.
Sleep
(
time
.
Millisecond
*
250
)
continue
continue
...
...
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