mirror of https://github.com/ollama/ollama
cloud: set the proxy content-type to the same as local models (#12759)
This commit is contained in:
parent
ad6f6a1d29
commit
b97eb2b858
|
|
@ -289,6 +289,12 @@ func (s *Server) GenerateHandler(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contentType := "application/json; charset=utf-8"
|
||||||
|
if req.Stream != nil && *req.Stream {
|
||||||
|
contentType = "application/x-ndjson"
|
||||||
|
}
|
||||||
|
c.Header("Content-Type", contentType)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1932,6 +1938,12 @@ func (s *Server) ChatHandler(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contentType := "application/json; charset=utf-8"
|
||||||
|
if req.Stream != nil && *req.Stream {
|
||||||
|
contentType = "application/x-ndjson"
|
||||||
|
}
|
||||||
|
c.Header("Content-Type", contentType)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue