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
7efbc843
"vscode:/vscode.git/clone" did not exist on "67f16199b9fc594e5eb0d082f89b0c197216da0e"
Unverified
Commit
7efbc843
authored
Sep 05, 2023
by
Michael Yang
Committed by
GitHub
Sep 05, 2023
Browse files
Merge pull request #464 from jmorganca/mxyng/fix-num-keep
fix num_keep
parents
8dc68417
681f3c4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
server/routes.go
server/routes.go
+2
-1
No files found.
server/routes.go
View file @
7efbc843
...
@@ -117,12 +117,13 @@ func load(ctx context.Context, model *Model, reqOpts map[string]interface{}, ses
...
@@ -117,12 +117,13 @@ func load(ctx context.Context, model *Model, reqOpts map[string]interface{}, ses
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
tokensNoSystem
,
err
:=
llmModel
.
Encode
(
ctx
,
promptNoSystem
)
tokensNoSystem
,
err
:=
llmModel
.
Encode
(
ctx
,
promptNoSystem
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
opts
.
NumKeep
=
len
(
tokensWithSystem
)
-
len
(
tokensNoSystem
)
+
1
opts
.
NumKeep
=
len
(
tokensWithSystem
)
-
len
(
tokensNoSystem
)
llmModel
.
SetOptions
(
opts
)
llmModel
.
SetOptions
(
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