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
c5ff443b
Commit
c5ff443b
authored
Apr 09, 2024
by
Daniel Hiltgen
Browse files
Handle very slow model loads
During testing, we're seeing some models take over 3 minutes.
parent
1524f323
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
llm/server.go
llm/server.go
+2
-1
No files found.
llm/server.go
View file @
c5ff443b
...
@@ -383,7 +383,8 @@ func (s *LlamaServer) Ping(ctx context.Context) error {
...
@@ -383,7 +383,8 @@ func (s *LlamaServer) Ping(ctx context.Context) error {
func
(
s
*
LlamaServer
)
waitUntilRunning
()
error
{
func
(
s
*
LlamaServer
)
waitUntilRunning
()
error
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
expiresAt
:=
time
.
Now
()
.
Add
(
3
*
time
.
Minute
)
// be generous with timeout, large models can take a while to load
// TODO we need to wire up a better way to detect hangs during model load and startup of the server
expiresAt
:=
time
.
Now
()
.
Add
(
10
*
time
.
Minute
)
// be generous with timeout, large models can take a while to load
ticker
:=
time
.
NewTicker
(
50
*
time
.
Millisecond
)
ticker
:=
time
.
NewTicker
(
50
*
time
.
Millisecond
)
defer
ticker
.
Stop
()
defer
ticker
.
Stop
()
...
...
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