Skip to content

Commit

Permalink
server: reset digest at end of generate
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorganca committed Aug 2, 2023
1 parent cc509a9 commit 03cff3a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -57,6 +57,7 @@ func GenerateHandler(c *gin.Context) {
if loaded.llm != nil {
loaded.llm.Close()
loaded.llm = nil
loaded.digest = ""
}

opts := api.DefaultOptions()
Expand Down Expand Up @@ -98,6 +99,7 @@ func GenerateHandler(c *gin.Context) {

loaded.llm.Close()
loaded.llm = nil
loaded.digest = ""
})
}
loaded.expireTimer.Reset(sessionDuration)
Expand Down

0 comments on commit 03cff3a

Please sign in to comment.