Skip to content

Commit

Permalink
fix crash bug with /save when quotes are used (ollama#8208)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdevine authored Dec 22, 2024
1 parent d8bab8e commit dd352ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ func buildModelfile(opts runOptions) string {
}

for _, msg := range opts.Messages {
if strings.Contains(msg.Content, "\"") {
msg.Content = `"""` + msg.Content + `"""`
}
f.Commands = append(f.Commands, parser.Command{Name: "message", Args: fmt.Sprintf("%s: %s", msg.Role, msg.Content)})
}

Expand Down

0 comments on commit dd352ab

Please sign in to comment.