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
2e537046
"vscode:/vscode.git/clone" did not exist on "5d585550108448429b5d568d2264b638a3a300e3"
Unverified
Commit
2e537046
authored
Nov 02, 2023
by
Jeffrey Morgan
Committed by
GitHub
Nov 02, 2023
Browse files
default rope params to 0 for new models (#968)
parent
527f9a79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
llm/llama.go
llm/llama.go
+8
-2
llm/llm.go
llm/llm.go
+4
-1
No files found.
llm/llama.go
View file @
2e537046
...
@@ -306,13 +306,19 @@ func newLlama(model string, adapters []string, runners []ModelRunner, numLayers
...
@@ -306,13 +306,19 @@ func newLlama(model string, adapters []string, runners []ModelRunner, numLayers
params
:=
[]
string
{
params
:=
[]
string
{
"--model"
,
model
,
"--model"
,
model
,
"--ctx-size"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumCtx
),
"--ctx-size"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumCtx
),
"--rope-freq-base"
,
fmt
.
Sprintf
(
"%f"
,
opts
.
RopeFrequencyBase
),
"--rope-freq-scale"
,
fmt
.
Sprintf
(
"%f"
,
opts
.
RopeFrequencyScale
),
"--batch-size"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumBatch
),
"--batch-size"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumBatch
),
"--n-gpu-layers"
,
fmt
.
Sprintf
(
"%d"
,
numGPU
),
"--n-gpu-layers"
,
fmt
.
Sprintf
(
"%d"
,
numGPU
),
"--embedding"
,
"--embedding"
,
}
}
if
opts
.
RopeFrequencyBase
>
0
{
params
=
append
(
params
,
"--rope-freq-base"
,
fmt
.
Sprintf
(
"%f"
,
opts
.
RopeFrequencyBase
))
}
if
opts
.
RopeFrequencyScale
>
0
{
params
=
append
(
params
,
"--rope-freq-scale"
,
fmt
.
Sprintf
(
"%f"
,
opts
.
RopeFrequencyScale
))
}
if
opts
.
NumGQA
>
0
{
if
opts
.
NumGQA
>
0
{
params
=
append
(
params
,
"--gqa"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumGQA
))
params
=
append
(
params
,
"--gqa"
,
fmt
.
Sprintf
(
"%d"
,
opts
.
NumGQA
))
}
}
...
...
llm/llm.go
View file @
2e537046
...
@@ -85,7 +85,10 @@ func New(workDir, model string, adapters []string, opts api.Options) (LLM, error
...
@@ -85,7 +85,10 @@ func New(workDir, model string, adapters []string, opts api.Options) (LLM, error
switch
ggml
.
Name
()
{
switch
ggml
.
Name
()
{
case
"gguf"
:
case
"gguf"
:
opts
.
NumGQA
=
0
// TODO: remove this when llama.cpp runners differ enough to need separate newLlama functions
// TODO: gguf will load these options automatically from the model binary
opts
.
NumGQA
=
0
opts
.
RopeFrequencyBase
=
0.0
opts
.
RopeFrequencyScale
=
0.0
return
newLlama
(
model
,
adapters
,
chooseRunners
(
workDir
,
"gguf"
),
ggml
.
NumLayers
(),
opts
)
return
newLlama
(
model
,
adapters
,
chooseRunners
(
workDir
,
"gguf"
),
ggml
.
NumLayers
(),
opts
)
case
"ggml"
,
"ggmf"
,
"ggjt"
,
"ggla"
:
case
"ggml"
,
"ggmf"
,
"ggjt"
,
"ggla"
:
return
newLlama
(
model
,
adapters
,
chooseRunners
(
workDir
,
"ggml"
),
ggml
.
NumLayers
(),
opts
)
return
newLlama
(
model
,
adapters
,
chooseRunners
(
workDir
,
"ggml"
),
ggml
.
NumLayers
(),
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