mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-09 12:37:07 +00:00
stop running model on interactive exit
This commit is contained in:
parent
62be2050dd
commit
fad00a85e5
@ -475,6 +475,14 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
|
|||||||
usage()
|
usage()
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(line, "/exit"), strings.HasPrefix(line, "/bye"):
|
case strings.HasPrefix(line, "/exit"), strings.HasPrefix(line, "/bye"):
|
||||||
|
// stop the running model
|
||||||
|
client, err := api.ClientFromEnvironment()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
client.Chat(cmd.Context(), &api.ChatRequest{Model: opts.Model, KeepAlive: &api.Duration{}}, func(resp api.ChatResponse) error {
|
||||||
|
return nil
|
||||||
|
})
|
||||||
return nil
|
return nil
|
||||||
case strings.HasPrefix(line, "/"):
|
case strings.HasPrefix(line, "/"):
|
||||||
args := strings.Fields(line)
|
args := strings.Fields(line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user