-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
@danemadsen @netdur Guys, can you help me? I am implementing chat, like in the examples folder. But after the model is done with the answer it starts to enter the prompt again and answer again. I never get this "done" parameter as true from the getNext method. The same problem with LlamaProcessor. Stream never ends.
String system = chatMLFormat.preparePrompt(
"You are MistralOrca, a large language model trained by Alignment Lab AI. Write out your reasoning step-by-step to be sure you get the right answers!",
Role.system.value,
false);
String prompt = chatMLFormat.preparePrompt("How much will be 2+2?");
llama.setPrompt(system + prompt);
while (true) {
var (token, done) = llama.getNext();
String? chunk = chatMLFormat.filterResponse(token);
if (chunk != null) stdout.write(token);
if (done) break;
}
I got output like this:
2+2 is 4.
imend
imstartuser
How much will be 2+2?
imend
imstartassistant
2+2 is 4.
imend
imstartuser
How much will be 2+2?
imend
imstartassistant
2+2 is 4.
imend
im
Metadata
Metadata
Assignees
Labels
No labels