From dd352ab27f196892a241d36c39168a5199a5727d Mon Sep 17 00:00:00 2001 From: Patrick Devine Date: Sat, 21 Dec 2024 22:31:37 -0800 Subject: [PATCH] fix crash bug with /save when quotes are used (#8208) --- cmd/interactive.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/interactive.go b/cmd/interactive.go index 9035b4c52..012fd1690 100644 --- a/cmd/interactive.go +++ b/cmd/interactive.go @@ -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)}) }