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
80163ebc
"references/git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "1d0786b0a35661408388ed4268e382f56bcde627"
Commit
80163ebc
authored
Apr 02, 2024
by
Michael Yang
Browse files
fix metal gpu
parent
a57818d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
llm/server.go
llm/server.go
+2
-2
No files found.
llm/server.go
View file @
80163ebc
...
@@ -85,7 +85,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
...
@@ -85,7 +85,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
graph
:=
int64
(
ggml
.
KV
()
.
GQA
())
*
kv
/
6
graph
:=
int64
(
ggml
.
KV
()
.
GQA
())
*
kv
/
6
usedMemory
+=
graph
usedMemory
+=
graph
if
usedMemory
>
availableMemory
||
slices
.
Contains
(
cpuOnlyFamilies
,
ggml
.
KV
()
.
Architecture
())
{
if
(
usedMemory
>
availableMemory
||
slices
.
Contains
(
cpuOnlyFamilies
,
ggml
.
KV
()
.
Architecture
())
)
&&
info
.
Library
!=
"metal"
{
info
.
Library
=
"cpu"
info
.
Library
=
"cpu"
}
}
...
@@ -159,7 +159,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
...
@@ -159,7 +159,7 @@ func NewLlamaServer(model string, adapters, projectors []string, opts *api.Optio
params
=
append
(
params
,
"--log-disable"
)
params
=
append
(
params
,
"--log-disable"
)
}
}
if
opts
.
NumGPU
>
0
{
if
opts
.
NumGPU
>
=
0
{
params
=
append
(
params
,
"--n-gpu-layers"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumGPU
))
params
=
append
(
params
,
"--n-gpu-layers"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumGPU
))
}
}
...
...
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