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
b9f4d675
Commit
b9f4d675
authored
Aug 03, 2023
by
Michael Yang
Browse files
configurable rope frequency parameters
parent
e3fb1fd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
21 deletions
+27
-21
api/types.go
api/types.go
+25
-21
llama/llama.go
llama/llama.go
+2
-0
No files found.
api/types.go
View file @
b9f4d675
...
...
@@ -147,19 +147,21 @@ type Options struct {
UseNUMA
bool
`json:"numa,omitempty"`
// Model options
NumCtx
int
`json:"num_ctx,omitempty"`
NumKeep
int
`json:"num_keep,omitempty"`
NumBatch
int
`json:"num_batch,omitempty"`
NumGQA
int
`json:"num_gqa,omitempty"`
NumGPU
int
`json:"num_gpu,omitempty"`
MainGPU
int
`json:"main_gpu,omitempty"`
LowVRAM
bool
`json:"low_vram,omitempty"`
F16KV
bool
`json:"f16_kv,omitempty"`
LogitsAll
bool
`json:"logits_all,omitempty"`
VocabOnly
bool
`json:"vocab_only,omitempty"`
UseMMap
bool
`json:"use_mmap,omitempty"`
UseMLock
bool
`json:"use_mlock,omitempty"`
EmbeddingOnly
bool
`json:"embedding_only,omitempty"`
NumCtx
int
`json:"num_ctx,omitempty"`
NumKeep
int
`json:"num_keep,omitempty"`
NumBatch
int
`json:"num_batch,omitempty"`
NumGQA
int
`json:"num_gqa,omitempty"`
NumGPU
int
`json:"num_gpu,omitempty"`
MainGPU
int
`json:"main_gpu,omitempty"`
LowVRAM
bool
`json:"low_vram,omitempty"`
F16KV
bool
`json:"f16_kv,omitempty"`
LogitsAll
bool
`json:"logits_all,omitempty"`
VocabOnly
bool
`json:"vocab_only,omitempty"`
UseMMap
bool
`json:"use_mmap,omitempty"`
UseMLock
bool
`json:"use_mlock,omitempty"`
EmbeddingOnly
bool
`json:"embedding_only,omitempty"`
RopeFrequencyBase
float32
`json:"rope_frequency_base,omitempty"`
RopeFrequencyScale
float32
`json:"rope_frequency_scale,omitempty"`
// Predict options
RepeatLastN
int
`json:"repeat_last_n,omitempty"`
...
...
@@ -261,14 +263,16 @@ func DefaultOptions() Options {
UseNUMA
:
false
,
NumCtx
:
2048
,
NumBatch
:
512
,
NumGPU
:
1
,
NumGQA
:
1
,
LowVRAM
:
false
,
F16KV
:
true
,
UseMMap
:
true
,
UseMLock
:
false
,
NumCtx
:
2048
,
NumBatch
:
512
,
NumGPU
:
1
,
NumGQA
:
1
,
LowVRAM
:
false
,
F16KV
:
true
,
UseMMap
:
true
,
UseMLock
:
false
,
RopeFrequencyBase
:
10000.0
,
RopeFrequencyScale
:
1.0
,
RepeatLastN
:
64
,
RepeatPenalty
:
1.1
,
...
...
llama/llama.go
View file @
b9f4d675
...
...
@@ -142,6 +142,8 @@ func New(model string, opts api.Options) (*LLM, error) {
params
.
use_mmap
=
C
.
bool
(
llm
.
UseMMap
)
params
.
use_mlock
=
C
.
bool
(
llm
.
UseMLock
)
params
.
embedding
=
C
.
bool
(
llm
.
EmbeddingOnly
)
params
.
rope_freq_base
=
C
.
float
(
llm
.
RopeFrequencyBase
)
params
.
rope_freq_scale
=
C
.
float
(
llm
.
RopeFrequencyScale
)
llm
.
params
=
&
params
cModel
:=
C
.
CString
(
model
)
...
...
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