Open simonw opened 7 months ago
The models3.json
file has this prompt template:
"promptTemplate": "<|user|>\n%1<|end|>\n<|assistant|>\n%2<|end|>\n",
Which should be picked up by this code here: https://github.com/simonw/llm-gpt4all/blob/363559a3accd49c5c0757a1bc843e0376c902bf2/llm_gpt4all.py#L136-L150
Maybe that special case involving the <|im_start|>
thing isn't working right because this model uses <|end|>
instead?
This is what was logged in SQLite:
{"full_prompt": "<|user|>\nsay nice things about otters<|end|>\n<|assistant|>\n%2<|end|>\n"}
Decoded using https://observablehq.com/@simonw/display-content-from-a-json-string
<|user|>
say nice things about otters<|end|>
<|assistant|>
%2<|end|>
What's that %2
doing?
The solution may be to switch to the chat session mechanism that GPT4All offers now - I don't think that was available when I first wrote this plugin: https://docs.gpt4all.io/gpt4all_python.html
model = GPT4All(model_name='orca-mini-3b-gguf2-q4_0.gguf')
with model.chat_session():
response1 = model.generate(prompt='hello', temp=0)
response2 = model.generate(prompt='write me a short poem', temp=0)
response3 = model.generate(prompt='thank you', temp=0)
print(model.current_chat_session)
Looks like Phi-3 Instruct is in @nomic_ai's gpt4all now: https://github.com/nomic-ai/gpt4all/commit/4193533154fc227bf6ce40ec1dff19aba1ee3929
I tried this:
(Downloads 2.18GB the first time you run it)
And got this: