check server is running before running command

This commit is contained in:
Bruce MacDonald
2023-08-02 10:51:23 -04:00
committed by GitHub
3 changed files with 91 additions and 25 deletions

View File

@@ -318,6 +318,9 @@ func Serve(ln net.Listener) error {
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Ollama is running")
})
r.HEAD("/", func(c *gin.Context) {
c.Status(http.StatusOK)
})
r.POST("/api/pull", PullModelHandler)
r.POST("/api/generate", GenerateHandler)