nomic-ai / pygpt4all

Official supported Python bindings for llama.cpp + gpt4all
https://nomic-ai.github.io/pygpt4all/
MIT License
1.02k stars 162 forks source link

[Question/Improvement]Add Save/Load binding from llama.cpp #56

Open simsim314 opened 1 year ago

simsim314 commented 1 year ago

First I want to say I really enjoy this binding, it's working as expected, useful and simple etc. etc.

But I would say I am missing one very crucial feature - save and load the model state to file. For example I want to ask the agent for improvement suggestions, and then use his suggestion as part of a prompt. All this means I want to save and load model state, and not run it all from the start again.

I've checked the llama repository and they had this issue and they closed it, as if it was solved.

I used chatGPT to write me save/load function based on their comments. Now I want to add it to llama, and then to here.

The question here would be: how would I add this functionality from llama.cpp to this binding?

P.S. Another small suggestion regardless of llama binding is the option to have a call_back function that would stop the generation, for example when ### Human / ### Instructions appears in the response.

abdeladim-s commented 1 year ago

Hi @simsim314,

Glad you are enjoying the bindings so far.

Regarding your suggestion (stop generation), I am working on it, I will drop a new version soon where interactive mode will be activated by default. So just stay updated.

Regarding the feature, it is really interesting, thanks for bringing it to my attention. Once I finish the new update, I will try to look into this. Thank you!