Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
76599436
Commit
76599436
authored
Aug 01, 2023
by
Bruce MacDonald
Browse files
use head to check heartbeat
parent
40a25bf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
api/client.go
api/client.go
+1
-1
server/routes.go
server/routes.go
+3
-0
No files found.
api/client.go
View file @
76599436
...
@@ -225,7 +225,7 @@ func (c *Client) Delete(ctx context.Context, req *DeleteRequest) error {
...
@@ -225,7 +225,7 @@ func (c *Client) Delete(ctx context.Context, req *DeleteRequest) error {
}
}
func
(
c
*
Client
)
Heartbeat
(
ctx
context
.
Context
)
error
{
func
(
c
*
Client
)
Heartbeat
(
ctx
context
.
Context
)
error
{
if
err
:=
c
.
do
(
ctx
,
http
.
Method
Get
,
"/"
,
nil
,
nil
);
err
!=
nil
{
if
err
:=
c
.
do
(
ctx
,
http
.
Method
Head
,
"/"
,
nil
,
nil
);
err
!=
nil
{
return
err
return
err
}
}
return
nil
return
nil
...
...
server/routes.go
View file @
76599436
...
@@ -319,6 +319,9 @@ func Serve(ln net.Listener) error {
...
@@ -319,6 +319,9 @@ func Serve(ln net.Listener) error {
r
.
GET
(
"/"
,
func
(
c
*
gin
.
Context
)
{
r
.
GET
(
"/"
,
func
(
c
*
gin
.
Context
)
{
c
.
String
(
http
.
StatusOK
,
"Ollama is running"
)
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/pull"
,
PullModelHandler
)
r
.
POST
(
"/api/generate"
,
GenerateHandler
)
r
.
POST
(
"/api/generate"
,
GenerateHandler
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment