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
10da41d6
Unverified
Commit
10da41d6
authored
Dec 22, 2023
by
K0IN
Committed by
GitHub
Dec 22, 2023
Browse files
Add Cache flag to api (#1642)
parent
db356c85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
api/types.go
api/types.go
+2
-0
docs/api.md
docs/api.md
+2
-1
llm/ext_server.go
llm/ext_server.go
+2
-1
No files found.
api/types.go
View file @
10da41d6
...
@@ -103,6 +103,7 @@ type Options struct {
...
@@ -103,6 +103,7 @@ type Options struct {
MirostatEta
float32
`json:"mirostat_eta,omitempty"`
MirostatEta
float32
`json:"mirostat_eta,omitempty"`
PenalizeNewline
bool
`json:"penalize_newline,omitempty"`
PenalizeNewline
bool
`json:"penalize_newline,omitempty"`
Stop
[]
string
`json:"stop,omitempty"`
Stop
[]
string
`json:"stop,omitempty"`
Cache
bool
`json:"cache,omitempty"`
}
}
// Runner options which must be set when the model is loaded into memory
// Runner options which must be set when the model is loaded into memory
...
@@ -355,6 +356,7 @@ func DefaultOptions() Options {
...
@@ -355,6 +356,7 @@ func DefaultOptions() Options {
MirostatEta
:
0.1
,
MirostatEta
:
0.1
,
PenalizeNewline
:
true
,
PenalizeNewline
:
true
,
Seed
:
-
1
,
Seed
:
-
1
,
Cache
:
true
,
Runner
:
Runner
{
Runner
:
Runner
{
// options set when the model is loaded
// options set when the model is loaded
...
...
docs/api.md
View file @
10da41d6
...
@@ -306,7 +306,8 @@ curl http://localhost:11434/api/generate -d '{
...
@@ -306,7 +306,8 @@ curl http://localhost:11434/api/generate -d '{
"embedding_only": false,
"embedding_only": false,
"rope_frequency_base": 1.1,
"rope_frequency_base": 1.1,
"rope_frequency_scale": 0.8,
"rope_frequency_scale": 0.8,
"num_thread": 8
"num_thread": 8,
"cache": true
}
}
}'
}'
```
```
...
...
llm/ext_server.go
View file @
10da41d6
...
@@ -234,7 +234,8 @@ func predict(llm extServer, opts api.Options, ctx context.Context, predict Predi
...
@@ -234,7 +234,8 @@ func predict(llm extServer, opts api.Options, ctx context.Context, predict Predi
"penalize_nl"
:
opts
.
PenalizeNewline
,
"penalize_nl"
:
opts
.
PenalizeNewline
,
"seed"
:
opts
.
Seed
,
"seed"
:
opts
.
Seed
,
"stop"
:
opts
.
Stop
,
"stop"
:
opts
.
Stop
,
"image_data"
:
imageData
,
"image_data"
:
imageData
,
"cache_prompt"
:
opts
.
Cache
,
}
}
if
predict
.
Format
==
"json"
{
if
predict
.
Format
==
"json"
{
...
...
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