mirror of
https://github.com/ollama/ollama.git
synced 2025-11-12 11:17:24 +01:00
Revert "runner: simplify parser entrypoints in runner (#12233)"
This reverts commit 8d6fffaead.
This commit is contained in:
committed by
Jeffrey Morgan
parent
053092185e
commit
9d56e63dbf
@@ -35,7 +35,6 @@ import (
|
||||
"github.com/ollama/ollama/logutil"
|
||||
"github.com/ollama/ollama/ml"
|
||||
"github.com/ollama/ollama/model"
|
||||
"github.com/ollama/ollama/parser"
|
||||
)
|
||||
|
||||
type filteredEnv []string
|
||||
@@ -1350,7 +1349,7 @@ type CompletionRequest struct {
|
||||
Options *api.Options
|
||||
|
||||
Grammar string // set before sending the request to the subprocess
|
||||
ParserType parser.TokenParserType
|
||||
UseHarmony bool
|
||||
PrefillString string
|
||||
}
|
||||
|
||||
@@ -1364,6 +1363,8 @@ const (
|
||||
DoneReasonLength
|
||||
// DoneReasonConnectionClosed indicates the completion stopped due to the connection being closed
|
||||
DoneReasonConnectionClosed
|
||||
// DoneReasonTokenRepeatLimit indicates the completion stopped due to a token repeat limit
|
||||
DoneReasonTokenRepeatLimit
|
||||
)
|
||||
|
||||
func (d DoneReason) String() string {
|
||||
@@ -1372,6 +1373,8 @@ func (d DoneReason) String() string {
|
||||
return "length"
|
||||
case DoneReasonStop:
|
||||
return "stop"
|
||||
case DoneReasonTokenRepeatLimit:
|
||||
return "token_repeat_limit"
|
||||
default:
|
||||
return "" // closed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user