close llm on interrupt (#577)
This commit is contained in:
parent
9df31c3518
commit
5d71bda478
1 changed files with 3 additions and 0 deletions
|
@ -570,6 +570,9 @@ func Serve(ln net.Listener, allowOrigins []string) error {
|
|||
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
|
||||
go func() {
|
||||
<-signals
|
||||
if loaded.llm != nil {
|
||||
loaded.llm.Close()
|
||||
}
|
||||
os.RemoveAll(workDir)
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
|
Loading…
Add table
Reference in a new issue