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
879e2caf
Unverified
Commit
879e2caf
authored
May 10, 2024
by
Daniel Hiltgen
Committed by
GitHub
May 10, 2024
Browse files
Merge pull request #4329 from dhiltgen/zero_layers
Fall back to CPU runner with zero layers
parents
be9efdb9
c4014e73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
llm/server.go
llm/server.go
+4
-0
No files found.
llm/server.go
View file @
879e2caf
...
@@ -105,6 +105,10 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
...
@@ -105,6 +105,10 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
// disable partial offloading when model is greater than total system memory as this
// disable partial offloading when model is greater than total system memory as this
// can lead to locking up the system
// can lead to locking up the system
opts
.
NumGPU
=
0
opts
.
NumGPU
=
0
}
else
if
gpus
[
0
]
.
Library
!=
"metal"
&&
layers
==
0
{
// Don't bother loading into the GPU if no layers can fit
cpuRunner
=
serverForCpu
()
gpuCount
=
0
}
else
if
opts
.
NumGPU
<
0
&&
layers
>
0
&&
gpus
[
0
]
.
Library
!=
"cpu"
{
}
else
if
opts
.
NumGPU
<
0
&&
layers
>
0
&&
gpus
[
0
]
.
Library
!=
"cpu"
{
opts
.
NumGPU
=
layers
opts
.
NumGPU
=
layers
}
}
...
...
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