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
d1692fd3
"vscode:/vscode.git/clone" did not exist on "76fca37ac8941b72a509a6e58d623632efe04543"
Unverified
Commit
d1692fd3
authored
May 15, 2024
by
Patrick Devine
Committed by
GitHub
May 15, 2024
Browse files
fix the cpu estimatedTotal memory + get the expiry time for loading models (#4461)
parent
5fa36a08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
llm/server.go
llm/server.go
+1
-0
server/routes.go
server/routes.go
+8
-0
No files found.
llm/server.go
View file @
d1692fd3
...
...
@@ -89,6 +89,7 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
cpuRunner
=
serverForCpu
()
gpuCount
=
0
_
,
_
,
estimatedTotal
=
EstimateGPULayers
(
gpus
,
ggml
,
projectors
,
opts
)
}
else
{
if
gpus
[
0
]
.
Library
==
"metal"
{
memInfo
,
err
:=
gpu
.
GetCPUMem
()
...
...
server/routes.go
View file @
d1692fd3
...
...
@@ -1161,6 +1161,14 @@ func (s *Server) ProcessHandler(c *gin.Context) {
Details
:
modelDetails
,
ExpiresAt
:
v
.
expiresAt
,
}
// The scheduler waits to set expiresAt, so if a model is loading it's
// possible that it will be set to the unix epoch. For those cases, just
// calculate the time w/ the sessionDuration instead.
var
epoch
time
.
Time
if
v
.
expiresAt
==
epoch
{
mr
.
ExpiresAt
=
time
.
Now
()
.
Add
(
v
.
sessionDuration
)
}
models
=
append
(
models
,
mr
)
}
...
...
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