Unverified Commit 9b8187b4 authored by frob's avatar frob Committed by GitHub
Browse files

server: skip parsing initial <think> if provided in the prompt for /api/generate (#12289)

parent 8b894933
...@@ -429,6 +429,9 @@ func (s *Server) GenerateHandler(c *gin.Context) { ...@@ -429,6 +429,9 @@ func (s *Server) GenerateHandler(c *gin.Context) {
OpeningTag: openingTag, OpeningTag: openingTag,
ClosingTag: closingTag, ClosingTag: closingTag,
} }
if strings.HasSuffix(strings.TrimSpace(prompt), openingTag) {
thinkingState.AddContent(openingTag)
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment