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
e1f0a0dc
Commit
e1f0a0dc
authored
Jul 12, 2023
by
Michael Yang
Browse files
fix eof error in generate
parent
b227261f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
llama/llama.go
llama/llama.go
+2
-2
No files found.
llama/llama.go
View file @
e1f0a0dc
...
...
@@ -199,10 +199,10 @@ func (llm *llama) generate(tokens []C.llama_token, fn func(string)) error {
token
,
err
:=
llm
.
sample
(
pastTokens
,
&
opts
)
switch
{
case
err
!=
nil
:
return
err
case
errors
.
Is
(
err
,
io
.
EOF
)
:
return
nil
case
err
!=
nil
:
return
err
}
fn
(
llm
.
detokenize
(
token
))
...
...
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