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
03cff3a2
Commit
03cff3a2
authored
Aug 02, 2023
by
Jeffrey Morgan
Browse files
server: reset digest at end of generate
parent
cc509a99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
server/routes.go
server/routes.go
+4
-2
No files found.
server/routes.go
View file @
03cff3a2
...
...
@@ -31,8 +31,8 @@ var loaded struct {
expireAt
time
.
Time
expireTimer
*
time
.
Timer
digest
string
options
api
.
Options
digest
string
options
api
.
Options
}
func
GenerateHandler
(
c
*
gin
.
Context
)
{
...
...
@@ -57,6 +57,7 @@ func GenerateHandler(c *gin.Context) {
if
loaded
.
llm
!=
nil
{
loaded
.
llm
.
Close
()
loaded
.
llm
=
nil
loaded
.
digest
=
""
}
opts
:=
api
.
DefaultOptions
()
...
...
@@ -98,6 +99,7 @@ func GenerateHandler(c *gin.Context) {
loaded
.
llm
.
Close
()
loaded
.
llm
=
nil
loaded
.
digest
=
""
})
}
loaded
.
expireTimer
.
Reset
(
sessionDuration
)
...
...
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