Skip to content

Commit 9b8187b

Browse files
authored
server: skip parsing initial <think> if provided in the prompt for /api/generate (ollama#12289)
1 parent 8b89493 commit 9b8187b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/routes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ func (s *Server) GenerateHandler(c *gin.Context) {
429429
OpeningTag: openingTag,
430430
ClosingTag: closingTag,
431431
}
432+
if strings.HasSuffix(strings.TrimSpace(prompt), openingTag) {
433+
thinkingState.AddContent(openingTag)
434+
}
432435
}
433436
}
434437

0 commit comments

Comments
 (0)