clear previous images when submitting an image to ollama run (#2316)

This commit is contained in:
Jeffrey Morgan 2024-02-01 21:30:26 -08:00 committed by GitHub
parent f43dea68d1
commit 38296ab352
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -496,6 +496,14 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
if err != nil {
return err
}
// clear all previous images for better responses
if len(images) > 0 {
for i := range opts.Messages {
opts.Messages[i].Images = nil
}
}
newMessage.Content = msg
newMessage.Images = images
}