-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save and load sessions #2063
Save and load sessions #2063
Conversation
opts.Messages = []api.Message{} | ||
fmt.Printf("Loading model '%s'\n", opts.Model) | ||
if err := loadModel(cmd, &opts); err != nil { | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug here because of the way we handle errors w/ the chat api. Ideally it wouldn't close the repl if it can't load the model.
fmt.Fprintln(os.Stderr, " /?, /help Help for a command") | ||
fmt.Fprintln(os.Stderr, " /? shortcuts Help for keyboard shortcuts") | ||
fmt.Fprintln(os.Stderr, " /set Set session variables") | ||
fmt.Fprintln(os.Stderr, " /show Show model information") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have to be part of this change, but /show modelfile
doesnt show MESSAGE
parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/show modelfile
is kinda messed up right now. It should really only include the deltas of things which have changed, and yes, include the messages. That's actually pretty easy to do (/save
already is creating this modelfile), but the problem is what if you want to see the modelfile of the original model? Right now it kinda mixes the two up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and reviewed, all looks good
is this available in the JSON API? I do see changes in routes but I am not familiar enough with the code base to understand if this is true. Any aid would be grateful. I want to resume session via API at a later time if possible. |
This change allows users to interactively save a session from the REPL, and then load it back up again later.
It also adds a new
MESSAGE
command for Modelfiles so that users can build their own session which can be created withollama create
.