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
020a3b35
Commit
020a3b35
authored
Aug 03, 2023
by
Michael Yang
Browse files
disable gpu for q5_0, q5_1, q8_0 quants
parent
fccf8d17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
llm/llm.go
llm/llm.go
+11
-0
No files found.
llm/llm.go
View file @
020a3b35
...
...
@@ -2,6 +2,7 @@ package llm
import
(
"fmt"
"log"
"os"
"github.com/jmorganca/ollama/api"
...
...
@@ -31,6 +32,16 @@ func New(model string, opts api.Options) (LLM, error) {
return
nil
,
err
}
switch
ggml
.
FileType
{
case
FileTypeF32
,
FileTypeF16
,
FileTypeQ5_0
,
FileTypeQ5_1
,
FileTypeQ8_0
:
if
opts
.
NumGPU
!=
0
{
// Q5_0, Q5_1, and Q8_0 do not support Metal API and will
// cause the runner to segmentation fault so disable GPU
log
.
Printf
(
"WARNING: GPU disabled for F32, F16, Q5_0, Q5_1, and Q8_0"
)
opts
.
NumGPU
=
0
}
}
switch
ggml
.
ModelFamily
{
case
ModelFamilyLlama
:
return
newLlama
(
model
,
opts
)
...
...
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